mirror of
https://github.com/internetee/registry.git
synced 2025-05-21 19:59:38 +02:00
Check if domain is transferrable before transfer #2845
This commit is contained in:
parent
65d67e16a3
commit
ac977d2b8c
1 changed files with 18 additions and 0 deletions
|
@ -579,6 +579,13 @@ class Epp::Domain < Domain
|
|||
# rubocop: disable Metrics/MethodLength
|
||||
# rubocop: disable Metrics/AbcSize
|
||||
def query_transfer(frame, current_user)
|
||||
unless transferrable?
|
||||
throw :epp_error, {
|
||||
code: '2304',
|
||||
msg: I18n.t(:object_status_prohibits_operation)
|
||||
}
|
||||
end
|
||||
|
||||
unless can_be_transferred_to?(current_user.registrar)
|
||||
throw :epp_error, {
|
||||
code: '2002',
|
||||
|
@ -741,6 +748,17 @@ class Epp::Domain < Domain
|
|||
new_registrar != registrar
|
||||
end
|
||||
|
||||
def transferrable?
|
||||
(statuses & [
|
||||
DomainStatus::PENDING_CREATE,
|
||||
DomainStatus::PENDING_UPDATE,
|
||||
DomainStatus::PENDING_DELETE,
|
||||
DomainStatus::PENDING_RENEW,
|
||||
DomainStatus::PENDING_TRANSFER,
|
||||
DomainStatus::FORCE_DELETE
|
||||
]).empty?
|
||||
end
|
||||
|
||||
## SHARED
|
||||
|
||||
# For domain transfer
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue