Skip to content

Commit

Permalink
Merge pull request #2351 from internetee/2349-remove-email-address-ve…
Browse files Browse the repository at this point in the history
…rifications

Remove email verification legacy code
  • Loading branch information
vohmar authored Apr 14, 2022
2 parents 47a93b2 + d0d40cc commit 451c39f
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 542 deletions.
1 change: 0 additions & 1 deletion app/controllers/admin/contacts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def filter_by_flags(contacts)
contacts = contacts.where("ident_country_code is null or ident_country_code=''")
end

contacts = contacts.email_verification_failed if params[:email_verification_failed].eql?('1')
contacts
end

Expand Down
8 changes: 1 addition & 7 deletions app/models/concerns/domain/force_delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ def notification_template(explicit: nil)
reason = explicit&.downcase
return reason if %w[invalid_email invalid_phone].include?(reason)

if contact_emails_verification_failed.present?
'invalid_email'
elsif registrant.org?
'legal_person'
else
'private_person'
end
registrant.org? ? 'legal_person' : 'private_person'
end

def force_delete_scheduled?
Expand Down
4 changes: 0 additions & 4 deletions app/models/concerns/email_verifable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ module EmailVerifable
scope :recently_not_validated, -> { where.not(id: ValidationEvent.validated_ids_by(name)) }
end

def email_verification_failed?
need_to_start_force_delete?
end

def validate_email_data(level:, count:)
validation_events.order(created_at: :desc).limit(count).all? do |event|
event.check_level == level.to_s && event.failed?
Expand Down
5 changes: 0 additions & 5 deletions app/models/contact.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ class Contact < ApplicationRecord
alias_attribute :kind, :ident_type
alias_attribute :copy_from_id, :original_id # Old attribute name; for PaperTrail

scope :email_verification_failed, lambda {
joins('LEFT JOIN email_address_verifications emv ON contacts.email = emv.email')
.where('success = false and verified_at IS NOT NULL')
}

scope :with_different_company_name, (lambda do |company|
where("ident = ? AND ident_country_code = 'EE' AND name != ?",
company.registration_number,
Expand Down
4 changes: 0 additions & 4 deletions app/models/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -734,10 +734,6 @@ def domain_name
DNS::DomainName.new(name)
end

def contact_emails_verification_failed
contacts.select(&:email_verification_failed?)&.map(&:email)&.uniq
end

def as_csv_row
[
name,
Expand Down
4 changes: 0 additions & 4 deletions app/presenters/domain_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ def force_delete_toggle_btn
end
end

def contact_emails_verification_failed
domain.contact_emails_verification_failed.join(', ')
end

def remove_registry_lock_btn
return unless domain.locked_by_registrant?

Expand Down
4 changes: 0 additions & 4 deletions app/views/admin/contacts/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@
.form-group
= label_tag :only_no_country_code, "Ident CC missing"
= check_box_tag :only_no_country_code, '1',params[:only_no_country_code].eql?('1'), style: 'width:auto;height:auto;float:right'
.col-md-3
.form-group
= label_tag :email_verification_failed, "Email verification failed"
= check_box_tag :email_verification_failed, '1',params[:email_verification_failed].eql?('1'), style: 'width:auto;height:auto;float:right'

.row
.col-md-3{style: 'padding-top: 25px;float:right;padding-right: 0px'}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveEmailAddressVerifications < ActiveRecord::Migration[6.1]
def change
# drop_table :email_address_verifications
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveEmailAddressesValidations < ActiveRecord::Migration[6.1]
def change
# drop_table :email_addresses_validations
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveEmailAddressesVerifications < ActiveRecord::Migration[6.1]
def change
# drop_table :email_addresses_verifications
end
end
Loading

0 comments on commit 451c39f

Please sign in to comment.