From 6f162e3f77fb872d773ac6083d7d77d56469f95b Mon Sep 17 00:00:00 2001 From: Matt Farnsworth Date: Fri, 30 Oct 2015 19:37:19 +0200 Subject: [PATCH] Story #104525314 - set pendingDeleteConfirmation when verifed not yes and confirmation required --- app/models/domain.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/models/domain.rb b/app/models/domain.rb index 2a7a1239f..370d83a87 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -482,8 +482,9 @@ class Domain < ActiveRecord::Base return true if pending_delete? 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? - set_pending_delete + pending_delete_confirmation! save(validate: false) # should check if this did succeed DomainMailer.pending_deleted(self).deliver_now @@ -699,6 +700,10 @@ class Domain < ActiveRecord::Base statuses.include? DomainStatus::PENDING_DELETE_CONFIRMATION end + def pending_delete_confirmation! + statuses << DomainStatus::PENDING_DELETE_CONFIRMATION unless pending_delete_prohibited? + end + def pending_delete_prohibited? (statuses_was & [ DomainStatus::CLIENT_DELETE_PROHIBITED,