mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Story#109623634 - No after-validate contacts callback for transfer
This commit is contained in:
parent
9fbeeb70a2
commit
4980bc591d
1 changed files with 4 additions and 2 deletions
|
@ -3,7 +3,7 @@ class Epp::Domain < Domain
|
||||||
include EppErrors
|
include EppErrors
|
||||||
|
|
||||||
# TODO: remove this spagetti once data in production is correct.
|
# TODO: remove this spagetti once data in production is correct.
|
||||||
attr_accessor :is_renewal
|
attr_accessor :is_renewal, :is_transfer
|
||||||
|
|
||||||
before_validation :manage_permissions
|
before_validation :manage_permissions
|
||||||
def manage_permissions
|
def manage_permissions
|
||||||
|
@ -14,7 +14,7 @@ class Epp::Domain < Domain
|
||||||
|
|
||||||
after_validation :validate_contacts
|
after_validation :validate_contacts
|
||||||
def validate_contacts
|
def validate_contacts
|
||||||
return true if is_renewal
|
return true if is_renewal || is_transfer
|
||||||
|
|
||||||
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? }
|
||||||
|
@ -592,6 +592,8 @@ class Epp::Domain < Domain
|
||||||
|
|
||||||
# rubocop: disable Metrics/CyclomaticComplexity
|
# rubocop: disable Metrics/CyclomaticComplexity
|
||||||
def transfer(frame, action, current_user)
|
def transfer(frame, action, current_user)
|
||||||
|
@is_transfer = true
|
||||||
|
|
||||||
case action
|
case action
|
||||||
when 'query'
|
when 'query'
|
||||||
return domain_transfers.last if domain_transfers.any?
|
return domain_transfers.last if domain_transfers.any?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue