added virtual attribute for skip whois update

This commit is contained in:
oleghasjanov 2025-01-13 11:14:04 +02:00
parent 38fdc35496
commit 9d036f9af3
4 changed files with 7 additions and 0 deletions

View file

@ -11,6 +11,7 @@ module Domains
# Allow deletion
statuses.delete(DomainStatus::CLIENT_DELETE_PROHIBITED)
domain.skip_whois_record_update = false
domain.save(validate: false)
end

View file

@ -8,6 +8,7 @@ module Domains
def execute
domain.force_delete_domain_statuses_history = domain.statuses
domain.statuses |= STATUSES_TO_SET
domain.skip_whois_record_update = true
domain.save(validate: false)
end
end

View file

@ -5,6 +5,7 @@ module Domains
domain.force_delete_type = type
type == :fast_track ? force_delete_fast_track : force_delete_soft
domain.status_notes[DomainStatus::FORCE_DELETE] = "Company no: #{domain.registrant.ident}" if reason == 'invalid_company'
domain.skip_whois_record_update = true
domain.save(validate: false)
end

View file

@ -89,6 +89,8 @@ class Domain < ApplicationRecord
has_many :registrant_verifications, dependent: :destroy
has_one :csync_record, dependent: :destroy
attribute :skip_whois_record_update, :boolean, default: false
after_initialize do
self.pending_json = {} if pending_json.blank?
self.statuses = [] if statuses.nil?
@ -719,6 +721,8 @@ class Domain < ApplicationRecord
end
def update_whois_record
return if skip_whois_record_update
UpdateWhoisRecordJob.set(wait: 1.minute).perform_later name, 'domain'
end