From 1d76c095f24aa2b270f2973f20a64a0ccdb68521 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Thu, 3 Dec 2015 18:31:24 +0200 Subject: [PATCH] Story#109014746 skip contacts validation if we are doing renewal --- app/models/epp/domain.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index afdc8e085..85e40a038 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -2,6 +2,9 @@ class Epp::Domain < Domain include EppErrors + # TODO: remove this spagetti once data in production is correct. + attr_accessor :is_renewal + before_validation :manage_permissions def manage_permissions return unless update_prohibited? || delete_prohibited? @@ -11,6 +14,8 @@ class Epp::Domain < Domain after_validation :validate_contacts def validate_contacts + return true if is_renewal + ok = true active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? } active_techs = tech_domain_contacts.select { |x| !x.marked_for_destruction? } @@ -565,6 +570,7 @@ class Epp::Domain < Domain ### RENEW ### def renew(cur_exp_date, period, unit = 'y') + @is_renewal = true validate_exp_dates(cur_exp_date) add_epp_error('2105', nil, nil, I18n.t('object_is_not_eligible_for_renewal')) unless renewable?