diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 732328337..1d71863ee 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -489,6 +489,15 @@ class Epp::Domain < Domain # at[:statuses] += at_add[:domain_statuses_attributes] + if registrant_id && registrant.code == frame.css('registrant') + + throw :epp_error, { + code: '2305', + msg: I18n.t(:contact_already_associated_with_the_domain) + } + + end + if errors.empty? && verify && Setting.request_confrimation_on_registrant_change_enabled && frame.css('registrant').present? && diff --git a/config/locales/en.yml b/config/locales/en.yml index db0ca37ce..26822ab0c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -935,4 +935,5 @@ en: add_reserved_domain: 'Add domain to reserved list' add_blocked_domain: 'Add domain to blocked list' edit_pw: 'Edit Pw' - optional: 'Optional' \ No newline at end of file + optional: 'Optional' + contact_already_associated_with_the_domain: 'Object association prohibits operation, contact already associated with the domain'