Story#107821878 - pending_deleted gets new registrant_id too

This commit is contained in:
Vladimir Krylov 2015-11-30 15:37:17 +02:00
parent 44ae8fd350
commit 4fa286d0b0
3 changed files with 5 additions and 6 deletions

View file

@ -106,8 +106,9 @@ class DomainMailer < ApplicationMailer
name: @domain.name)} [#{@domain.name}]")
end
def pending_deleted(domain_id, should_deliver)
def pending_deleted(domain_id, old_registrant_id, should_deliver)
@domain = Domain.find_by(id: domain_id)
@old_registrant = Registrant.find(old_registrant_id)
return unless @domain
return if delivery_off?(@domain, should_deliver)
@ -121,8 +122,6 @@ class DomainMailer < ApplicationMailer
return
end
@old_registrant = Registrant.find(@domain.registrant_id_was)
confirm_path = "#{ENV['registrant_url']}/registrant/domain_delete_confirms"
@verification_url = "#{confirm_path}/#{@domain.id}?token=#{@domain.registrant_verification_token}"

View file

@ -490,7 +490,7 @@ class Domain < ActiveRecord::Base
pending_delete_confirmation!
save(validate: false) # should check if this did succeed
DomainMailer.pending_deleted(id, deliver_emails).deliver
DomainMailer.pending_deleted(id, registrant_id_was, deliver_emails).deliver
end
def pricelist(operation, period_i = nil, unit = nil)