mirror of
https://github.com/internetee/registry.git
synced 2025-07-20 01:36:02 +02:00
Tech replace: Skip if domain has update prohibited
This commit is contained in:
parent
44226aa5d6
commit
5693d0dd74
2 changed files with 7 additions and 2 deletions
|
@ -492,7 +492,7 @@ class Domain < ApplicationRecord
|
||||||
|
|
||||||
# depricated not used, not valid
|
# depricated not used, not valid
|
||||||
def update_prohibited?
|
def update_prohibited?
|
||||||
pending_update_prohibited? && pending_delete_prohibited?
|
(statuses & DomainStatus::UPDATE_PROHIBIT_STATES).present?
|
||||||
end
|
end
|
||||||
|
|
||||||
# public api
|
# public api
|
||||||
|
|
|
@ -6,7 +6,7 @@ class TechDomainContact < DomainContact
|
||||||
tech_contacts = where(contact: current_contact)
|
tech_contacts = where(contact: current_contact)
|
||||||
|
|
||||||
tech_contacts.each do |tech_contact|
|
tech_contacts.each do |tech_contact|
|
||||||
if tech_contact.domain.bulk_update_prohibited?
|
if irreplaceable?(tech_contact)
|
||||||
skipped_domains << tech_contact.domain.name
|
skipped_domains << tech_contact.domain.name
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
@ -20,4 +20,9 @@ class TechDomainContact < DomainContact
|
||||||
end
|
end
|
||||||
[affected_domains.sort, skipped_domains.sort]
|
[affected_domains.sort, skipped_domains.sort]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.irreplaceable?(tech_contact)
|
||||||
|
dn = tech_contact.domain
|
||||||
|
dn.bulk_update_prohibited? || dn.update_prohibited? || dn.tech_change_prohibited?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue