mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
Admin contact cannot be juridical
This commit is contained in:
parent
bc80274109
commit
20be38fd0b
4 changed files with 359 additions and 277 deletions
|
@ -124,12 +124,17 @@ class Epp::EppDomain < Domain
|
|||
contacts.each do |k, v|
|
||||
v.each do |x|
|
||||
contact = Contact.find_by(code: x[:contact])
|
||||
if contact
|
||||
attach_contact(k, contact)
|
||||
else
|
||||
# Detailed error message with value to display in EPP response
|
||||
unless contact
|
||||
add_epp_error('2303', 'contact', x[:contact], [:domain_contacts, :not_found])
|
||||
next
|
||||
end
|
||||
|
||||
if k == :admin && contact.juridical?
|
||||
add_epp_error('2306', 'contact', x[:contact], [:domain_contacts, :admin_contact_can_be_only_citizen])
|
||||
next
|
||||
end
|
||||
|
||||
attach_contact(k, contact)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue