diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 3f32ce6d5..3ac02c721 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -488,6 +488,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 8a79c45d7..ea1d90b5e 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -931,3 +931,4 @@ en: if_auth_info_is_left_empty_it_will_be_auto_generated: 'If auth info is left empty, it will be auto generated.' each_domain_name_must_end_with_colon_sign: 'Each domain name must end with colon (:) sign.' expiration_remind_subject: 'The %{name} domain has expired' + contact_already_associated_with_the_domain: 'Object association prohibits operation, contact already associated with the domain'