From: David Gageot Date: Thu, 14 Jun 2012 14:33:55 +0000 (+0200) Subject: FIX Stay on password update form when the update failed because password X-Git-Tag: 3.2~324 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0abecc76c2076a56e2427e61c83173bb0a33e15c;p=sonarqube.git FIX Stay on password update form when the update failed because password is empty --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb index 755bf5a9bfc..b238a0bf709 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb @@ -46,7 +46,7 @@ class UsersController < ApplicationController flash[:notice] = 'User is created.' end to_index(user.errors, nil) - end + end end @@ -91,12 +91,13 @@ class UsersController < ApplicationController if params[:user][:password].blank? flash[:error] = 'Password required.' - + 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) end - to_index(user.errors, nil) end def update @@ -111,7 +112,7 @@ class UsersController < ApplicationController to_index(user.errors, nil) end - + def reactivate user = User.find_by_login(params[:user][:login]) if user