修改密码验证的方法

This commit is contained in:
z9hang 2014-12-03 16:14:11 +08:00
parent d82f1f5696
commit ec21a98e64
2 changed files with 3 additions and 3 deletions

View File

@ -930,7 +930,7 @@ class User < Principal
def validate_password_length
# Password length validation based on setting
if !password.nil? && password.size < Setting.password_min_length.to_i
if password.nil? || password.size < Setting.password_min_length.to_i
errors.add(:password, :too_short, :count => Setting.password_min_length.to_i)
end
end