Story #104525314 - bug fix, now pendingDeleteConfirmation must transit to pendingDelete, or cancel pending

This commit is contained in:
Matt Farnsworth 2015-11-18 12:42:04 +02:00
parent a48abe621e
commit 64b0e391a4
3 changed files with 9 additions and 6 deletions

View file

@ -7,12 +7,10 @@ class DomainDeleteConfirmJob < Que::Job
when RegistrantVerification::CONFIRMED
domain.poll_message!(:poll_pending_delete_confirmed_by_registrant)
domain.apply_pending_delete!
domain.clean_pendings!
when RegistrantVerification::REJECTED
DomainMailer.pending_delete_rejected_notification(domain).deliver_now
domain.statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
domain.poll_message!(:poll_pending_delete_rejected_by_registrant)
domain.clean_pendings!
domain.cancel_pending_delete
end
destroy # it's best to destroy the job in the same transaction
end

View file

@ -492,6 +492,12 @@ class Domain < ActiveRecord::Base
DomainMailer.pending_deleted(self).deliver_now
end
def cancel_pending_delete
statuses.delete DomainStatus::PENDING_DELETE_CONFIRMATION
statuses.delete DomainStatus::PENDING_DELETE
delete_at = nil
end
def pricelist(operation, period_i = nil, unit = nil)
period_i ||= period
unit ||= period_unit

View file

@ -487,9 +487,8 @@ class Epp::Domain < Domain
statuses.delete(DomainStatus::PENDING_DELETE_CONFIRMATION)
statuses.delete(DomainStatus::PENDING_DELETE)
DomainMailer.delete_confirmation(self).deliver_now
# TODO: confirm that this actually makes sense
clean_pendings! if valid? && set_pending_delete!
clean_pendings!
set_pending_delete!
true
end