]> source.dussan.org Git - redmine.git/commitdiff
Fixed: error on account/register when validation fails.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 23 Nov 2007 23:23:39 +0000 (23:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Fri, 23 Nov 2007 23:23:39 +0000 (23:23 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@925 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/account_controller.rb

index 37a810bdf216b584383d1d6ffb4bf1f3805e07ce..a1cbf5ffd9cd79b2a9e6f0565864fb686fab6f27 100644 (file)
@@ -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