mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
added breakpoints
This commit is contained in:
parent
bc54a3f70c
commit
84aa93e97b
2 changed files with 14 additions and 8 deletions
|
@ -47,7 +47,6 @@ module Api
|
||||||
|
|
||||||
def update
|
def update
|
||||||
logger.debug 'Received update request'
|
logger.debug 'Received update request'
|
||||||
logger.debug params
|
|
||||||
contact = find_contact_and_update_credentials(params[:uuid], params[:name], params[:email], params[:phone])
|
contact = find_contact_and_update_credentials(params[:uuid], params[:name], params[:email], params[:phone])
|
||||||
|
|
||||||
reparsed_request = reparsed_request(request.body.string)
|
reparsed_request = reparsed_request(request.body.string)
|
||||||
|
@ -62,7 +61,6 @@ module Api
|
||||||
contact.registrant_publishable = publishable if publishable.in? [true, false]
|
contact.registrant_publishable = publishable if publishable.in? [true, false]
|
||||||
|
|
||||||
logger.debug "Setting.address_processing is set to #{Setting.address_processing}"
|
logger.debug "Setting.address_processing is set to #{Setting.address_processing}"
|
||||||
|
|
||||||
contact.address = parse_address(params[:address]) if Setting.address_processing && params[:address]
|
contact.address = parse_address(params[:address]) if Setting.address_processing && params[:address]
|
||||||
render_address_error and return if !Setting.address_processing && params[:address]
|
render_address_error and return if !Setting.address_processing && params[:address]
|
||||||
|
|
||||||
|
@ -136,11 +134,15 @@ module Api
|
||||||
|
|
||||||
def update_and_notify!(contact)
|
def update_and_notify!(contact)
|
||||||
contact.transaction do
|
contact.transaction do
|
||||||
contact.save!
|
if contact.save
|
||||||
action = current_registrant_user.actions.create!(contact: contact, operation: :update)
|
action = current_registrant_user.actions.create!(contact: contact, operation: :update)
|
||||||
contact.registrar.notify(action)
|
contact.registrar.notify(action)
|
||||||
|
else
|
||||||
|
logger.info '&&&&&&&&&&&&&&&&&7'
|
||||||
|
logger.info contact.errors.inspect
|
||||||
|
logger.info '&&&&&&&&&&&&&&&&&7'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
contact
|
contact
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -153,7 +155,11 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_contact_and_update_credentials(uuid, name, email, phone)
|
def find_contact_and_update_credentials(uuid, name, email, phone)
|
||||||
contact = current_user_contacts.find_by!(uuid: uuid)
|
contact = current_registrant_user.contacts.find_by!(uuid: uuid)
|
||||||
|
p '-----------'
|
||||||
|
p current_registrant_user
|
||||||
|
p current_registrant_user.contacts
|
||||||
|
p '----------'
|
||||||
contact.name = name if name.present?
|
contact.name = name if name.present?
|
||||||
contact.email = email if email.present?
|
contact.email = email if email.present?
|
||||||
contact.phone = phone if phone.present?
|
contact.phone = phone if phone.present?
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Contact < ApplicationRecord
|
||||||
validate :validate_html
|
validate :validate_html
|
||||||
validate :validate_country_code, if: -> { self.class.address_processing? }
|
validate :validate_country_code, if: -> { self.class.address_processing? }
|
||||||
validates :registrant_publishable, inclusion: { in: [true, false] }, if: -> { registrant? }
|
validates :registrant_publishable, inclusion: { in: [true, false] }, if: -> { registrant? }
|
||||||
validates :registrant_publishable, inclusion: { in: [false] }, unless: -> { registrant? }
|
# validates :registrant_publishable, inclusion: { in: [false] }, unless: -> { registrant? }
|
||||||
|
|
||||||
after_initialize do
|
after_initialize do
|
||||||
self.status_notes = {} if status_notes.nil?
|
self.status_notes = {} if status_notes.nil?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue