Merge branch 'master' of github.com:internetee/registry

This commit is contained in:
Martin Lensment 2014-08-22 13:00:12 +03:00
commit ac29ab9014
2 changed files with 16 additions and 6 deletions

View file

@ -88,7 +88,8 @@ class Contact < ActiveRecord::Base
clean_up_address clean_up_address
if has_relation(:domain_contacts) || domains_owned.present? 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 return false
end end
destroy destroy
@ -96,10 +97,18 @@ class Contact < ActiveRecord::Base
def epp_code_map def epp_code_map
{ {
'2302' => [[:code, :epp_id_taken]], '2302' => [ #Object exists
'2303' => [:not_found, :epp_obj_does_not_exist], [:code, :epp_id_taken]
'2305' => ['Object association prohibits operation' ], ],
'2005' => ['Phone nr is invalid', 'Email is invalid'] '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 end

View file

@ -37,6 +37,8 @@ en:
invalid: "Email is invalid" invalid: "Email is invalid"
ident: ident:
blank: "Required parameter missing - ident" blank: "Required parameter missing - ident"
domains:
exist: 'Object association prohibits operation'
domain: domain:
attributes: attributes:
name_dirty: name_dirty:
@ -91,7 +93,6 @@ en:
epp_exp_dates_do_not_match: 'Given and current expire dates do not match' epp_exp_dates_do_not_match: 'Given and current expire dates do not match'
epp_registrant_not_found: 'Registrant not found' epp_registrant_not_found: 'Registrant not found'
required_parameter_missing: 'Required parameter missing: %{key}' required_parameter_missing: 'Required parameter missing: %{key}'
epp_obj_association_error: 'Object association prohibits operation'
setting_groups: setting_groups:
codes: codes: