0
0
Fork 0

Fix Lint/DuplicateBranch cop (#24766)

This commit is contained in:
Matt Jankowski 2023-05-02 06:57:11 -04:00 committed by GitHub
parent f50105779b
commit 88d33f361f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 56 additions and 31 deletions

View file

@ -8,9 +8,7 @@ class EmailMxValidator < ActiveModel::Validator
domain = get_domain(user.email)
if domain.blank?
user.errors.add(:email, :invalid)
elsif domain.include?('..')
if domain.blank? || domain.include?('..')
user.errors.add(:email, :invalid)
elsif !on_allowlist?(domain)
resolved_ips, resolved_domains = resolve_mx(domain)