]> git.openstreetmap.org Git - rails.git/commitdiff
Redirect back to settings after updating user settings
authorTom Hughes <tom@compton.nu>
Fri, 7 May 2010 09:01:24 +0000 (10:01 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 7 May 2010 09:01:24 +0000 (10:01 +0100)
When we've saved a user's settings, redirect back to their settings
page instead of just rerendering so that a suspended user check will
be done.

app/controllers/user_controller.rb

index e5db74f38ee9c019701fa7db53836d00cf94210b..5b9f5a0c754b1feb3f6d16dc7ef1adae53e0622e 100644 (file)
@@ -70,9 +70,9 @@ class UserController < ApplicationController
         set_locale
 
         if @user.new_email.nil? or @user.new_email.empty?
         set_locale
 
         if @user.new_email.nil? or @user.new_email.empty?
-          flash.now[:notice] = t 'user.account.flash update success'
+          flash[:notice] = t 'user.account.flash update success'
         else
         else
-          flash.now[:notice] = t 'user.account.flash update success confirm needed'
+          flash[:notice] = t 'user.account.flash update success confirm needed'
 
           begin
             Notifier.deliver_email_confirm(@user, @user.tokens.create)
 
           begin
             Notifier.deliver_email_confirm(@user, @user.tokens.create)
@@ -80,6 +80,8 @@ class UserController < ApplicationController
             # Ignore errors sending email
           end
         end
             # Ignore errors sending email
           end
         end
+
+        redirect_to :action => "account", :display_name => @user.display_name
       end
     else
       if flash[:errors]
       end
     else
       if flash[:errors]