X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/bddf524c888c7364119a673e9b6c0518b0c6f93d..2f0ed542062ddd592238e7a74ca0da2c1291f1b7:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index e5a2f04bd..c8603afec 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -32,7 +32,12 @@ class UserController < ApplicationController if @user if @user.invalid? - render :action => :new + if @user.new_record? + render :action => :new + else + flash[:errors] = @user.errors + redirect_to :action => :account, :display_name => @user.display_name + end elsif @user.terms_agreed? redirect_to :action => :account, :display_name => @user.display_name end @@ -123,7 +128,7 @@ class UserController < ApplicationController else if flash[:errors] flash[:errors].each do |attr,msg| - attr = "new_email" if attr == "email" + attr = "new_email" if attr == "email" and !@user.new_email.nil? @user.errors.add(attr,msg) end end