mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
Story #104525314 - remove pendingDeleteConfirmation when expired
This commit is contained in:
parent
08b9d0251f
commit
c55695d328
1 changed files with 7 additions and 2 deletions
|
@ -223,7 +223,7 @@ class Domain < ActiveRecord::Base
|
|||
count = 0
|
||||
expired_pending_domains = Domain.where('registrant_verification_asked_at <= ?', expire_at)
|
||||
expired_pending_domains.each do |domain|
|
||||
unless domain.pending_update? || domain.pending_delete?
|
||||
unless domain.pending_update? || domain.pending_delete? || pending_delete_confirmation?
|
||||
msg = "#{Time.zone.now.utc} - ISSUE: DOMAIN #{domain.id}: #{domain.name} IS IN EXPIRED PENDING LIST, " \
|
||||
"but no pendingDelete/pendingUpdate state present!\n"
|
||||
STDOUT << msg unless Rails.env.test?
|
||||
|
@ -233,7 +233,7 @@ class Domain < ActiveRecord::Base
|
|||
if domain.pending_update?
|
||||
DomainMailer.pending_update_expired_notification_for_new_registrant(domain).deliver_now
|
||||
end
|
||||
if domain.pending_delete?
|
||||
if domain.pending_delete? || pending_delete_confirmation?
|
||||
DomainMailer.pending_delete_expired_notification(domain).deliver_now
|
||||
end
|
||||
domain.clean_pendings!
|
||||
|
@ -399,6 +399,7 @@ class Domain < ActiveRecord::Base
|
|||
def clean_pendings!
|
||||
preclean_pendings
|
||||
self.pending_json = {}
|
||||
statuses.delete[DomainStatus::PENDING_DELETE_CONFIRMATION]
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||
status_notes[DomainStatus::PENDING_UPDATE] = ''
|
||||
|
@ -694,6 +695,10 @@ class Domain < ActiveRecord::Base
|
|||
statuses.include?(DomainStatus::PENDING_DELETE) && !statuses.include?(DomainStatus::FORCE_DELETE)
|
||||
end
|
||||
|
||||
def pending_delete_confirmation?
|
||||
statuses.include? DomainStatus::PENDING_DELETE_CONFIRMATION
|
||||
end
|
||||
|
||||
def pending_delete_prohibited?
|
||||
(statuses_was & [
|
||||
DomainStatus::CLIENT_DELETE_PROHIBITED,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue