From 866e9e2503713c67fd33b389d4e840c04ce1562d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Fri, 23 Nov 2007 23:23:39 +0000 Subject: [PATCH] Fixed: error on account/register when validation fails. git-svn-id: http://redmine.rubyforge.org/svn/trunk@925 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/account_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 37a810bd..a1cbf5ff 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -115,10 +115,10 @@ class AccountController < ApplicationController @user.login = params[:user][:login] @user.status = User::STATUS_REGISTERED @user.password, @user.password_confirmation = params[:password], params[:password_confirmation] - if params["custom_fields"] - @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, :customized => @user, :value => params["custom_fields"][x.id.to_s]) } - @user.custom_values = @custom_values - end + @custom_values = UserCustomField.find(:all).collect { |x| CustomValue.new(:custom_field => x, + :customized => @user, + :value => (params["custom_fields"] ? params["custom_fields"][x.id.to_s] : nil)) } + @user.custom_values = @custom_values case Setting.self_registration when '1' # Email activation