mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 13:44:47 +02:00
Move template decision method to FD concern
This commit is contained in:
parent
7d6d53e420
commit
a6702267e5
2 changed files with 6 additions and 6 deletions
|
@ -22,7 +22,7 @@ module Admin
|
||||||
send_email
|
send_email
|
||||||
domain.update(contact_notification_sent_date: Time.zone.today)
|
domain.update(contact_notification_sent_date: Time.zone.today)
|
||||||
else
|
else
|
||||||
domain.update(template_name: template_name)
|
domain.update(template_name: domain.notification_template)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,10 +34,6 @@ module Admin
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def template_name
|
|
||||||
domain.registrant.org? ? 'legal_person' : 'private_person'
|
|
||||||
end
|
|
||||||
|
|
||||||
def domain
|
def domain
|
||||||
@domain ||= Domain.find(params[:domain_id])
|
@domain ||= Domain.find(params[:domain_id])
|
||||||
end
|
end
|
||||||
|
@ -50,7 +46,7 @@ module Admin
|
||||||
DomainDeleteMailer.forced(domain: domain,
|
DomainDeleteMailer.forced(domain: domain,
|
||||||
registrar: domain.registrar,
|
registrar: domain.registrar,
|
||||||
registrant: domain.registrant,
|
registrant: domain.registrant,
|
||||||
template_name: template_name).deliver_now
|
template_name: domain.notification_template).deliver_now
|
||||||
end
|
end
|
||||||
|
|
||||||
def force_delete_type
|
def force_delete_type
|
||||||
|
|
|
@ -19,6 +19,10 @@ module Concerns::Domain::ForceDelete # rubocop:disable Metrics/ModuleLength
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def notification_template
|
||||||
|
registrant.org? ? 'legal_person' : 'private_person'
|
||||||
|
end
|
||||||
|
|
||||||
def force_delete_scheduled?
|
def force_delete_scheduled?
|
||||||
statuses.include?(DomainStatus::FORCE_DELETE)
|
statuses.include?(DomainStatus::FORCE_DELETE)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue