Skip to content

Commit

Permalink
Merge pull request #2461 from internetee/2460-fix-force-delete-lift-p…
Browse files Browse the repository at this point in the history
…oll-messages

fix check force delete lift poll messages
  • Loading branch information
vohmar authored Oct 17, 2022
2 parents 241f745 + 62f18c0 commit 4510616
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
14 changes: 2 additions & 12 deletions app/jobs/check_force_delete_lift.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
2 changes: 0 additions & 2 deletions test/models/domain/force_delete_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4510616

Please sign in to comment.