mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Added unified update_prohibited method for epp #2786
This commit is contained in:
parent
a809329421
commit
c5a8a69099
2 changed files with 5 additions and 1 deletions
|
@ -566,6 +566,10 @@ class Domain < ActiveRecord::Base
|
|||
statuses.include?(DomainStatus::PENDING_UPDATE)
|
||||
end
|
||||
|
||||
def update_prohibited?
|
||||
pending_update_prohibited? && pending_delete_prohibited?
|
||||
end
|
||||
|
||||
# TODO: Review the list and disallow epp calls
|
||||
def pending_update_prohibited?
|
||||
(statuses & [
|
||||
|
|
|
@ -4,7 +4,7 @@ class Epp::Domain < Domain
|
|||
|
||||
before_validation :manage_permissions
|
||||
def manage_permissions
|
||||
return unless pending_update? || pending_delete?
|
||||
return unless update_prohibited?
|
||||
add_epp_error('2304', nil, nil, I18n.t(:object_status_prohibits_operation))
|
||||
false
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue