mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Allow removing bic admin contacts
This commit is contained in:
parent
647f98935f
commit
9cbe38effe
1 changed files with 7 additions and 5 deletions
|
@ -168,7 +168,7 @@ class Epp::Domain < Domain
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_contacts_attrs(frame, action)
|
def domain_contacts_attrs(frame, action)
|
||||||
contact_list = domain_contact_list_from(frame)
|
contact_list = domain_contact_list_from(frame, action)
|
||||||
|
|
||||||
if action == 'rem'
|
if action == 'rem'
|
||||||
to_destroy = []
|
to_destroy = []
|
||||||
|
@ -195,7 +195,7 @@ class Epp::Domain < Domain
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_contact_list_from(frame)
|
def domain_contact_list_from(frame, action)
|
||||||
res = []
|
res = []
|
||||||
frame.css('contact').each do |x|
|
frame.css('contact').each do |x|
|
||||||
c = Contact.find_by(code: x.text)
|
c = Contact.find_by(code: x.text)
|
||||||
|
@ -205,9 +205,11 @@ class Epp::Domain < Domain
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
if x['type'] == 'admin' && c.bic?
|
if action != 'rem'
|
||||||
add_epp_error('2306', 'contact', x.text, [:domain_contacts, :admin_contact_can_be_only_citizen])
|
if x['type'] == 'admin' && c.bic?
|
||||||
next
|
add_epp_error('2306', 'contact', x.text, [:domain_contacts, :admin_contact_can_be_only_citizen])
|
||||||
|
next
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
res << {
|
res << {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue