mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: disposable invite was giving email validation error
This commit is contained in:
parent
93f4c016b7
commit
fab2b95ab6
1 changed files with 2 additions and 2 deletions
|
@ -10,7 +10,7 @@ class EmailValidator < ActiveModel::EachValidator
|
|||
record.errors.add(attribute, I18n.t(:'user.email.not_allowed'))
|
||||
end
|
||||
end
|
||||
if record.errors[attribute].blank? and ScreenedEmail.should_block?(value)
|
||||
if record.errors[attribute].blank? && value && ScreenedEmail.should_block?(value)
|
||||
record.errors.add(attribute, I18n.t(:'user.email.blocked'))
|
||||
end
|
||||
end
|
||||
|
@ -25,4 +25,4 @@ class EmailValidator < ActiveModel::EachValidator
|
|||
/^[a-zA-Z0-9!#\$%&'*+\/=?\^_`{|}~\-]+(?:\.[a-zA-Z0-9!#\$%&'\*+\/=?\^_`{|}~\-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?$/
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue