From f490d16a198225b592dd5701fe464c9d56f5b910 Mon Sep 17 00:00:00 2001 From: Stas Date: Tue, 5 Apr 2016 17:15:34 +0300 Subject: [PATCH 1/2] 116207475-error_added --- app/models/epp/domain.rb | 5 ++++- config/locales/en.yml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index d1da30a2f..85498422e 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -133,7 +133,8 @@ class Epp::Domain < Domain [:base, :ds_data_not_allowed], [:base, :key_data_not_allowed], [:period, :not_a_number], - [:period, :not_an_integer] + [:period, :not_an_integer], + [:registrant, :cannot_be_missing] ], '2308' => [ [:base, :domain_name_blocked, { value: { obj: 'name', val: name_dirty } }] @@ -166,6 +167,8 @@ class Epp::Domain < Domain else add_epp_error('2303', 'registrant', code, [:registrant, :not_found]) end + else + add_epp_error('2306', nil, nil, [:registrant, :cannot_be_missing]) end at[:name] = frame.css('name').text if new_record? diff --git a/config/locales/en.yml b/config/locales/en.yml index 6b9a7af3c..e687458cc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -77,6 +77,7 @@ en: registrant: blank: 'Registrant is missing' not_found: 'Registrant not found' + cannot_be_missing: 'Parameter value policy error: registrant cannot be missing' domain_contacts: invalid: 'Contacts are invalid' not_found: 'Contact was not found' From 3063c2f5d22bf342ca19d2dcd5757f26e26641ec Mon Sep 17 00:00:00 2001 From: Stas Date: Thu, 7 Apr 2016 11:50:34 +0300 Subject: [PATCH 2/2] 116207475-if_block_changed --- app/models/epp/domain.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 85498422e..477d8c28f 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -156,7 +156,8 @@ class Epp::Domain < Domain def attrs_from(frame, current_user, action = nil) at = {}.with_indifferent_access - code = frame.css('registrant').first.try(:text) + registrant_frame = frame.css('registrant').first + code = registrant_frame.try(:text) if code.present? if action == 'chg' && registrant_change_prohibited? add_epp_error('2304', nil, DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation)) @@ -168,8 +169,9 @@ class Epp::Domain < Domain add_epp_error('2303', 'registrant', code, [:registrant, :not_found]) end else - add_epp_error('2306', nil, nil, [:registrant, :cannot_be_missing]) - end + add_epp_error('2306', nil, nil, [:registrant, :cannot_be_missing]) + end if registrant_frame + at[:name] = frame.css('name').text if new_record? at[:registrar_id] = current_user.registrar.try(:id)