Fix contact deletion if contact *DeleteProhibited

This commit is contained in:
Alex Sherman 2021-02-15 14:51:01 +05:00
parent fad739d279
commit 340e1820f2
4 changed files with 10 additions and 2 deletions

View file

@ -19,6 +19,11 @@ module Actions
return return
end end
if contact.delete_prohibited?
contact.errors.add(:status, :delete_prohibited)
return
end
commit commit
end end

View file

@ -83,7 +83,8 @@ class Epp::Contact < Contact
[:code, :epp_id_taken] [:code, :epp_id_taken]
], ],
'2305' => [ # Association exists '2305' => [ # Association exists
[:domains, :exist] [:domains, :exist],
[:domains, :delete_prohibited],
] ]
} }
end end

View file

@ -25,6 +25,8 @@ en:
email_regex_check_error: Invalid format email_regex_check_error: Invalid format
domains: domains:
exist: 'Object association prohibits operation' exist: 'Object association prohibits operation'
status:
delete_prohibited: Contact delete prohibited by status
statuses: statuses:
not_uniq: 'not uniq' not_uniq: 'not uniq'
country_code: country_code:

View file

@ -115,4 +115,4 @@ class EppContactDeleteBaseTest < EppTestCase
DomainContact.delete_all DomainContact.delete_all
contacts(:john) contacts(:john)
end end
end end