FIX: Allow merging users when email domains are restricted

This commit is contained in:
David Taylor
2020-06-09 18:51:59 +01:00
parent a3cf1cf6ff
commit ae6c4cd237
3 changed files with 12 additions and 1 deletions

View File

@@ -1200,7 +1200,7 @@ class User < ActiveRecord::Base
if primary_email
new_record? ? primary_email.email = new_email : primary_email.update(email: new_email)
else
self.primary_email = UserEmail.new(email: new_email, user: self, primary: true)
self.primary_email = UserEmail.new(email: new_email, user: self, primary: true, skip_validate_email: !should_validate_email_address?)
end
end