]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/confirmations_controller.rb
Merge remote-tracking branch 'upstream/pull/3791'
[rails.git] / app / controllers / confirmations_controller.rb
index 7b1c52ca68876ad3a22f24f0ac9d22bb91489c8d..06e7c8e7d33f4d3519ff6921c3d88ea0c3a0a8af 100644 (file)
@@ -25,7 +25,7 @@ class ConfirmationsController < ApplicationController
         render_unknown_user token.user.display_name
       else
         user = token.user
         render_unknown_user token.user.display_name
       else
         user = token.user
-        user.status = "active"
+        user.activate
         user.email_valid = true
         flash[:notice] = gravatar_status_message(user) if gravatar_enable(user)
         user.save!
         user.email_valid = true
         flash[:notice] = gravatar_status_message(user) if gravatar_enable(user)
         user.save!
@@ -93,13 +93,13 @@ class ConfirmationsController < ApplicationController
         current_user.tokens.delete_all
         session[:user] = current_user.id
         session[:fingerprint] = current_user.fingerprint
         current_user.tokens.delete_all
         session[:user] = current_user.id
         session[:fingerprint] = current_user.fingerprint
-        redirect_to :controller => :users, :action => :account, :display_name => current_user.display_name
       elsif token
         flash[:error] = t "confirmations.confirm_email.failure"
       elsif token
         flash[:error] = t "confirmations.confirm_email.failure"
-        redirect_to :controller => :users, :action => :account, :display_name => token.user.display_name
       else
         flash[:error] = t "confirmations.confirm_email.unknown_token"
       end
       else
         flash[:error] = t "confirmations.confirm_email.unknown_token"
       end
+
+      redirect_to edit_account_path
     end
   end
 
     end
   end