From ec21a98e642278421f262475f553ee98c4a6ebbc Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 3 Dec 2014 16:14:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 4 ++-- app/models/user.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 70a1f340b..21be0f793 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -154,7 +154,7 @@ class AccountController < ApplicationController else register_manually_by_administrator(@user) end - + #added by bai if @user.id != nil ue = @user.user_extensions ||= UserExtensions.new @@ -168,7 +168,7 @@ class AccountController < ApplicationController ue.location_city = params[:city] if params[:city] != nil ue.save end - + end end if params[:identity] == "2" diff --git a/app/models/user.rb b/app/models/user.rb index 29709519d..ef327f47f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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