FIX: disposable invite was giving email validation error

This commit is contained in:
Arpit Jalan 2014-10-23 22:55:49 +05:30
parent 93f4c016b7
commit fab2b95ab6

View file

@ -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