diff --git a/app/jobs/check_force_delete_lift.rb b/app/jobs/check_force_delete_lift.rb index 4ad43fb4a6..524c4bcdcc 100644 --- a/app/jobs/check_force_delete_lift.rb +++ b/app/jobs/check_force_delete_lift.rb @@ -6,8 +6,8 @@ def perform .select { |d| d.registrant.need_to_lift_force_delete? } handle_refresh_status(domains) if domains.present? - domains = Domain.where("force_delete_data->'template_name' = ?", 'invalid_email') - .where("force_delete_data->'force_delete_type' = ?", 'soft') + domains = (domains + Domain.where("force_delete_data->'template_name' = ?", 'invalid_email') + .where("force_delete_data->'force_delete_type' = ?", 'soft')).uniq domains.each do |domain| Domains::ForceDeleteLift::Base.run(domain: domain) @@ -39,15 +39,5 @@ def refresh_status_notes(domain, registrant) domain.status_notes[DomainStatus::FORCE_DELETE].slice!(registrant.email_history) domain.status_notes[DomainStatus::FORCE_DELETE].lstrip! domain.save(validate: false) - - notify_registrar(domain) unless domain.status_notes[DomainStatus::FORCE_DELETE].empty? - 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 end diff --git a/test/models/domain/force_delete_test.rb b/test/models/domain/force_delete_test.rb index 7032a1f91c..c333b12df7 100644 --- a/test/models/domain/force_delete_test.rb +++ b/test/models/domain/force_delete_test.rb @@ -457,8 +457,6 @@ def test_remove_invalid_email_from_domain_status_notes domain.reload assert_nil domain.status_notes[DomainStatus::FORCE_DELETE] - notification = domain.registrar.notifications.last(2).first - assert notification.text.include? asserted_text assert_not domain.force_delete_scheduled? end