]> source.dussan.org Git - sonarqube.git/commitdiff
FIX SONAR-3667 Unable to change user password
authorDavid Gageot <david@gageot.net>
Tue, 17 Jul 2012 15:38:07 +0000 (17:38 +0200)
committerDavid Gageot <david@gageot.net>
Tue, 17 Jul 2012 15:38:07 +0000 (17:38 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb

index a187754727c4ce1ce4c49e744111b29d3eb823ee..1e4fe52d4cda9576c03c02a10b17068edb11907e 100644 (file)
@@ -94,8 +94,10 @@ class UsersController < ApplicationController
       redirect_to(:action => 'change_password', :id => params[:id])
     elsif user.update_attributes(:password => params[:user][:password], :password_confirmation => params[:user][:password_confirmation])
       flash[:notice] = 'Password was successfully updated.'
-    else
       to_index(user.errors, nil)
+    else
+      flash[:error] = user.errors.full_messages.join("<br/>\n")
+      redirect_to(:action => 'change_password', :id => params[:id])
     end
 
   end