Merge pull request #2271 from internetee/2216-update-fd-notes

Update FD notes when basis of the FD is changed
This commit is contained in:
Timo Võhmar 2022-02-23 17:17:58 +02:00 committed by GitHub
commit c232e8ade6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 139 additions and 143 deletions

View file

@ -84,6 +84,7 @@ module Actions
return false if @error
contact.generate_code
contact.email_history = contact.email
contact.save
end
end

View file

@ -112,6 +112,7 @@ module Actions
email_changed = contact.will_save_change_to_email?
old_email = contact.email_was
contact.email_history = old_email
updated = contact.save
if updated && email_changed && contact.registrant?

View file

@ -23,11 +23,20 @@ module Domains
def before_execute_force_delete(domain)
if domain.force_delete_scheduled? && !domain.status_notes[DomainStatus::FORCE_DELETE].nil?
added_additional_email_into_notes(domain)
notify_registrar(domain)
else
process_force_delete(domain)
end
end
def notify_registrar(domain)
domain.registrar.notifications.create!(text: I18n.t('force_delete_auto_email',
domain_name: domain.name,
outzone_date: domain.outzone_date,
purge_date: domain.purge_date,
email: domain.status_notes[DomainStatus::FORCE_DELETE]))
end
def process_force_delete(domain)
domain.schedule_force_delete(type: :soft,
notify_by_email: true,