mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
Merge branch 'story/109014746-update-only-ident-cc' into staging
This commit is contained in:
commit
7fe823f326
1 changed files with 6 additions and 0 deletions
|
@ -2,6 +2,9 @@
|
||||||
class Epp::Domain < Domain
|
class Epp::Domain < Domain
|
||||||
include EppErrors
|
include EppErrors
|
||||||
|
|
||||||
|
# TODO: remove this spagetti once data in production is correct.
|
||||||
|
attr_accessor :is_renewal
|
||||||
|
|
||||||
before_validation :manage_permissions
|
before_validation :manage_permissions
|
||||||
def manage_permissions
|
def manage_permissions
|
||||||
return if is_admin # this bad hack for 109086524, refactor later
|
return if is_admin # this bad hack for 109086524, refactor later
|
||||||
|
@ -12,6 +15,8 @@ class Epp::Domain < Domain
|
||||||
|
|
||||||
after_validation :validate_contacts
|
after_validation :validate_contacts
|
||||||
def validate_contacts
|
def validate_contacts
|
||||||
|
return true if is_renewal
|
||||||
|
|
||||||
ok = true
|
ok = true
|
||||||
active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? }
|
active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? }
|
||||||
active_techs = tech_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 ###
|
### RENEW ###
|
||||||
|
|
||||||
def renew(cur_exp_date, period, unit = 'y')
|
def renew(cur_exp_date, period, unit = 'y')
|
||||||
|
@is_renewal = true
|
||||||
validate_exp_dates(cur_exp_date)
|
validate_exp_dates(cur_exp_date)
|
||||||
|
|
||||||
add_epp_error('2105', nil, nil, I18n.t('object_is_not_eligible_for_renewal')) unless renewable?
|
add_epp_error('2105', nil, nil, I18n.t('object_is_not_eligible_for_renewal')) unless renewable?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue