mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
parent
3d6a0936c7
commit
a63e2b9dd2
3 changed files with 86 additions and 16 deletions
|
@ -1,6 +1,7 @@
|
|||
class Epp::ContactsController < EppController
|
||||
before_action :find_contact, only: [:info, :update, :delete]
|
||||
before_action :find_password, only: [:info, :update, :delete]
|
||||
helper_method :address_processing?
|
||||
|
||||
def info
|
||||
authorize! :info, @contact, @password
|
||||
|
@ -24,7 +25,7 @@ class Epp::ContactsController < EppController
|
|||
@contact.generate_code
|
||||
|
||||
if @contact.save
|
||||
if !Contact.address_processing? && address_given?
|
||||
if !address_processing? && address_given?
|
||||
@response_code = 1100
|
||||
@response_description = t('epp.contacts.completed_without_address')
|
||||
else
|
||||
|
@ -44,7 +45,7 @@ class Epp::ContactsController < EppController
|
|||
frame = params[:parsed_frame]
|
||||
|
||||
if @contact.update_attributes(frame, current_user)
|
||||
if !Contact.address_processing? && address_given?
|
||||
if !address_processing? && address_given?
|
||||
@response_code = 1100
|
||||
@response_description = t('epp.contacts.completed_without_address')
|
||||
else
|
||||
|
@ -125,7 +126,7 @@ class Epp::ContactsController < EppController
|
|||
'postalInfo > addr > cc',
|
||||
]
|
||||
|
||||
required_attributes.concat(address_attributes) if Contact.address_processing?
|
||||
required_attributes.concat(address_attributes) if address_processing?
|
||||
|
||||
requires(*required_attributes)
|
||||
ident = params[:parsed_frame].css('ident')
|
||||
|
@ -202,4 +203,8 @@ class Epp::ContactsController < EppController
|
|||
def address_given?
|
||||
params[:parsed_frame].css('postalInfo addr').size != 0
|
||||
end
|
||||
|
||||
def address_processing?
|
||||
Contact.address_processing?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue