Improved Lift Force Delete

This commit is contained in:
tsoganov 2025-05-22 14:55:54 +03:00
parent 3e3c42ce7e
commit 12625ac210
4 changed files with 11 additions and 7 deletions

View file

@ -2,10 +2,17 @@ module Domains
module CancelForceDelete module CancelForceDelete
class CancelForceDelete < Base class CancelForceDelete < Base
def execute def execute
compose(RemoveForceDeleteStatuses, inputs.to_h) Domain.transaction do
compose(RestoreStatusesBeforeForceDelete, inputs.to_h) compose(RemoveForceDeleteStatuses, inputs.to_h)
compose(ClearForceDeleteData, inputs.to_h) compose(RestoreStatusesBeforeForceDelete, inputs.to_h)
compose(NotifyRegistrar, inputs.to_h) compose(ClearForceDeleteData, inputs.to_h)
# Save the domain once with all accumulated changes
# This will create a single PaperTrail version
domain.save(validate: false)
compose(NotifyRegistrar, inputs.to_h)
end
end end
end end
end end

View file

@ -7,7 +7,6 @@ module Domains
domain.force_delete_start = nil domain.force_delete_start = nil
domain.status_notes[DomainStatus::FORCE_DELETE] = nil domain.status_notes[DomainStatus::FORCE_DELETE] = nil
domain.skip_whois_record_update = false domain.skip_whois_record_update = false
domain.save(validate: false)
end end
end end
end end

View file

@ -19,7 +19,6 @@ module Domains
reason: domain.status_notes[DomainStatus::FORCE_DELETE], reason: domain.status_notes[DomainStatus::FORCE_DELETE],
date: Time.zone.now date: Time.zone.now
} }
domain.save(validate: false)
end end
end end
end end

View file

@ -9,7 +9,6 @@ module Domains
domain.force_delete_domain_statuses_history = nil domain.force_delete_domain_statuses_history = nil
domain.admin_store_statuses_history = nil domain.admin_store_statuses_history = nil
domain.skip_whois_record_update = true domain.skip_whois_record_update = true
domain.save(validate: false)
end end
end end
end end