mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Story#111503520 - custom lowlevel pending state rejection
This commit is contained in:
parent
782fcc9dec
commit
d9d8aef813
2 changed files with 21 additions and 3 deletions
|
@ -12,8 +12,7 @@ class DomainUpdateConfirmJob < Que::Job
|
|||
when RegistrantVerification::REJECTED
|
||||
domain.send_mail :pending_update_rejected_notification_for_new_registrant
|
||||
domain.poll_message!(:poll_pending_update_rejected_by_registrant)
|
||||
domain.clean_pendings!
|
||||
domain.save(validate: false)
|
||||
domain.clean_pendings_lowlevel
|
||||
end
|
||||
destroy # it's best to destroy the job in the same transaction
|
||||
end
|
||||
|
|
|
@ -244,7 +244,7 @@ class Domain < ActiveRecord::Base
|
|||
if domain.pending_delete? || domain.pending_delete_confirmation?
|
||||
DomainMailer.pending_delete_expired_notification(domain.id, true).deliver
|
||||
end
|
||||
domain.clean_pendings!
|
||||
domain.clean_pendings_lowlevel
|
||||
unless Rails.env.test?
|
||||
STDOUT << "#{Time.zone.now.utc} Domain.clean_expired_pendings: ##{domain.id} (#{domain.name})\n"
|
||||
end
|
||||
|
@ -439,6 +439,25 @@ class Domain < ActiveRecord::Base
|
|||
save
|
||||
end
|
||||
|
||||
|
||||
# state change shouln't be
|
||||
def clean_pendings_lowlevel
|
||||
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
|
||||
statuses.delete(DomainStatus::PENDING_UPDATE)
|
||||
statuses.delete(DomainStatus::PENDING_DELETE)
|
||||
|
||||
status_notes[DomainStatus::PENDING_UPDATE] = ''
|
||||
status_notes[DomainStatus::PENDING_DELETE] = ''
|
||||
|
||||
update_columns(
|
||||
registrant_verification_token: nil,
|
||||
registrant_verification_asked_at: nil,
|
||||
pending_json: {},
|
||||
status_notes: status_notes,
|
||||
statuses: statuses.presence || [DomainStatus::OK]
|
||||
)
|
||||
end
|
||||
|
||||
def pending_update!
|
||||
return true if pending_update?
|
||||
self.epp_pending_update = true # for epp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue