diff options
author | David Gageot <david@gageot.net> | 2012-06-14 16:33:55 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-06-14 17:31:58 +0200 |
commit | 0abecc76c2076a56e2427e61c83173bb0a33e15c (patch) | |
tree | 2107470449ffa1f9a9e193ceb3df0ae79af173f0 | |
parent | 627de7e0c768fc6dfa7d290f2af7ba89a44cec5b (diff) | |
download | sonarqube-0abecc76c2076a56e2427e61c83173bb0a33e15c.tar.gz sonarqube-0abecc76c2076a56e2427e61c83173bb0a33e15c.zip |
FIX Stay on password update form when the update failed because password
is empty
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/users_controller.rb | 9 |
1 files changed, 5 insertions, 4 deletions
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 |