mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 21:25:39 +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
|
validate :status_is_consistant
|
||||||
def status_is_consistant
|
def status_is_consistant
|
||||||
has_error = (hold_status? && statuses.include?(DomainStatus::SERVER_MANUAL_INZONE))
|
has_error = (hold_status? && statuses.include?(DomainStatus::SERVER_MANUAL_INZONE))
|
||||||
if !has_error && (statuses & DELETE_STATUSES).any?
|
if !has_error && statuses.include?(DomainStatus::PENDING_DELETE)
|
||||||
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED unless locked_by_registrant?
|
has_error = statuses.include? DomainStatus::SERVER_DELETE_PROHIBITED
|
||||||
end
|
end
|
||||||
errors.add(:domains, I18n.t(:object_status_prohibits_operation)) if has_error
|
errors.add(:domains, I18n.t(:object_status_prohibits_operation)) if has_error
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue