diff --git a/app/models/contact.rb b/app/models/contact.rb index 39d616512..bcfb6b61f 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -88,7 +88,8 @@ class Contact < ActiveRecord::Base clean_up_address if has_relation(:domain_contacts) || domains_owned.present? - errors.add(:contact, msg: I18n.t('errors.messages.epp_obj_association_error'), value: { obj: 'contact', val: code }) + #errors.add(:contact, msg: I18n.t('errors.messages.epp_obj_association_error'), value: { obj: 'contact', val: code }) + errors.add(:domains, :exist) return false end destroy @@ -96,10 +97,18 @@ class Contact < ActiveRecord::Base def epp_code_map { - '2302' => [[:code, :epp_id_taken]], - '2303' => [:not_found, :epp_obj_does_not_exist], - '2305' => ['Object association prohibits operation' ], - '2005' => ['Phone nr is invalid', 'Email is invalid'] + '2302' => [ #Object exists + [:code, :epp_id_taken] + ], + '2303' => #Object does not exist + [:not_found, :epp_obj_does_not_exist], + '2305' => [ #Association exists + [:domains, :exist] + ], + '2005' => [ #Value syntax error + [:phone, :invalid], + [:email, :invalid] + ] } end diff --git a/config/locales/en.yml b/config/locales/en.yml index f1a1f3258..42d5e768d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -37,6 +37,8 @@ en: invalid: "Email is invalid" ident: blank: "Required parameter missing - ident" + domains: + exist: 'Object association prohibits operation' domain: attributes: name_dirty: @@ -91,7 +93,6 @@ en: epp_exp_dates_do_not_match: 'Given and current expire dates do not match' epp_registrant_not_found: 'Registrant not found' required_parameter_missing: 'Required parameter missing: %{key}' - epp_obj_association_error: 'Object association prohibits operation' setting_groups: codes: