修正修改资料时报密码过短错误

course_group
z9hang 11 years ago
parent f025922312
commit d71581d834

@ -138,6 +138,8 @@ class AccountController < ApplicationController
@user.password,@user.password_confirmation = password,password_confirmation
elsif !should_confirmation_password && !password.blank?
@user.password = password
else
@user.password = ""
end
case Setting.self_registration
when '1'

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

Loading…
Cancel
Save