Story #104525314 - set pendingDeleteConfirmation when verifed not yes and confirmation required

This commit is contained in:
Matt Farnsworth 2015-10-30 19:37:19 +02:00
parent c55695d328
commit 6f162e3f77

View file

@ -482,8 +482,9 @@ class Domain < ActiveRecord::Base
return true if pending_delete? return true if pending_delete?
self.epp_pending_delete = true # for epp self.epp_pending_delete = true # for epp
# TODO: if this were to ever return true, that would be wrong. EPP would report sucess pending
return true unless registrant_verification_asked? return true unless registrant_verification_asked?
set_pending_delete pending_delete_confirmation!
save(validate: false) # should check if this did succeed save(validate: false) # should check if this did succeed
DomainMailer.pending_deleted(self).deliver_now DomainMailer.pending_deleted(self).deliver_now
@ -699,6 +700,10 @@ class Domain < ActiveRecord::Base
statuses.include? DomainStatus::PENDING_DELETE_CONFIRMATION statuses.include? DomainStatus::PENDING_DELETE_CONFIRMATION
end end
def pending_delete_confirmation!
statuses << DomainStatus::PENDING_DELETE_CONFIRMATION unless pending_delete_prohibited?
end
def pending_delete_prohibited? def pending_delete_prohibited?
(statuses_was & [ (statuses_was & [
DomainStatus::CLIENT_DELETE_PROHIBITED, DomainStatus::CLIENT_DELETE_PROHIBITED,