mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +02:00
Fix domain statuses logic
This commit is contained in:
parent
07e791da36
commit
fa5203d0a1
1 changed files with 2 additions and 2 deletions
|
@ -121,8 +121,8 @@ class Domain < ApplicationRecord
|
|||
validate :status_is_consistant
|
||||
def status_is_consistant
|
||||
has_error = (hold_status? && statuses.include?(DomainStatus::SERVER_MANUAL_INZONE))
|
||||
if !has_error && (statuses & DELETE_STATUSES).any?
|
||||
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED unless locked_by_registrant?
|
||||
if !has_error && statuses.include?(DomainStatus::PENDING_DELETE)
|
||||
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED
|
||||
end
|
||||
errors.add(:domains, I18n.t(:object_status_prohibits_operation)) if has_error
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue