mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
fixed storing lockable statuses
This commit is contained in:
parent
9c0018d6fe
commit
3f8a99d8ca
3 changed files with 11 additions and 3 deletions
|
@ -557,9 +557,17 @@ class Domain < ApplicationRecord
|
|||
|
||||
# special handling for admin changing status
|
||||
def admin_status_update(update)
|
||||
lock_statuses = [DomainStatus::SERVER_UPDATE_PROHIBITED,
|
||||
DomainStatus::SERVER_DELETE_PROHIBITED,
|
||||
DomainStatus::SERVER_TRANSFER_PROHIBITED]
|
||||
# check for deleted status
|
||||
update(admin_store_statuses_history: update) unless locked_by_registrant?
|
||||
|
||||
update(admin_store_statuses_history: update)
|
||||
if locked_by_registrant?
|
||||
result = update.reject { |status| lock_statuses.include? status }
|
||||
update(admin_store_statuses_history: result)
|
||||
|
||||
end
|
||||
statuses.each do |s|
|
||||
unless update.include? s
|
||||
case s
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue