diff --git a/app/models/user.rb b/app/models/user.rb index 33decbab32d..29f2ab3ba6d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -90,7 +90,7 @@ class User < ApplicationRecord validates :email, presence: true, email_address: true, length: { maximum: 320 } validates :email, email_mx: { attempt_ip: :sign_up_ip }, if: :validate_email_dns? - validates_with UserEmailValidator, if: -> { ENV['EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION'] == 'true' || !confirmed? } + validates_with UserEmailValidator, if: -> { (ENV['EMAIL_DOMAIN_LISTS_APPLY_AFTER_CONFIRMATION'] == 'true' || !confirmed?) && will_save_change_to_email? } validates :agreement, acceptance: { allow_nil: false, accept: [true, 'true', '1'] }, on: :create # Honeypot/anti-spam fields