Merge pull request #3949 from bgr11n/bugfix/fix_password_validator

fixed password validator on equality with email
This commit is contained in:
Robin Ward 2016-01-06 10:32:49 -05:00
commit 1a1f2ff5ee
1 changed files with 1 additions and 1 deletions

View File

@ -10,7 +10,7 @@ class PasswordValidator < ActiveModel::EachValidator
record.errors.add(attribute, :too_short, count: SiteSetting.min_password_length) record.errors.add(attribute, :too_short, count: SiteSetting.min_password_length)
elsif record.username.present? && value == record.username elsif record.username.present? && value == record.username
record.errors.add(attribute, :same_as_username) record.errors.add(attribute, :same_as_username)
elsif record.username.present? && value == record.email elsif record.email.present? && value == record.email
record.errors.add(attribute, :same_as_email) record.errors.add(attribute, :same_as_email)
elsif SiteSetting.block_common_passwords && CommonPasswords.common_password?(value) elsif SiteSetting.block_common_passwords && CommonPasswords.common_password?(value)
record.errors.add(attribute, :common) record.errors.add(attribute, :common)