From 9cf287b35c2e6e270991ec4f00d4a1b641b3a8a7 Mon Sep 17 00:00:00 2001 From: Matt Farnsworth Date: Tue, 17 Nov 2015 17:48:11 +0200 Subject: [PATCH] Story #104525314 - fix missing error message on probibited change admin/tech contact --- app/models/epp/domain.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index f59df6ddc..2b273f93a 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -236,7 +236,7 @@ class Epp::Domain < Domain def admin_domain_contacts_attrs(frame, action) admin_attrs = domain_contact_attrs_from(frame, action, 'admin') - if action && !admin_attrs.empty? && admin_change_prohibited? + if admin_attrs.present? && admin_change_prohibited? add_epp_error('2304', 'admin', DomainStatus::SERVER_ADMIN_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation)) return [] end @@ -252,7 +252,7 @@ class Epp::Domain < Domain def tech_domain_contacts_attrs(frame, action) tech_attrs = domain_contact_attrs_from(frame, action, 'tech') - if action && !tech_attrs.empty? && tech_change_prohibited? + if tech_attrs.present? && tech_change_prohibited? add_epp_error('2304', 'tech', DomainStatus::SERVER_TECH_CHANGE_PROHIBITED, I18n.t(:object_status_prohibits_operation)) return [] end @@ -439,7 +439,7 @@ class Epp::Domain < Domain at.deep_merge!(attrs_from(frame.css('chg'), current_user, 'chg')) at.deep_merge!(attrs_from(frame.css('rem'), current_user, 'rem')) - at_add = attrs_from(frame.css('add'), current_user) + at_add = attrs_from(frame.css('add'), current_user, 'add') at[:nameservers_attributes] += at_add[:nameservers_attributes] if !at[:admin_domain_contacts_attributes].empty? && admin_change_prohibited?