From 359b953a597b36b74cdddd0cf7f68463f879cfb2 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Tue, 15 Jan 2013 16:25:02 +0100 Subject: [PATCH] SONAR-4064 No way to edit a user when its password is empty --- sonar-server/src/main/webapp/WEB-INF/app/models/user.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/user.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/user.rb index ff6bcd6ebbc..829589ba362 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/user.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/user.rb @@ -212,4 +212,9 @@ class User < ActiveRecord::Base def notify_creation_handlers Java::OrgSonarServerUi::JRubyFacade.getInstance().onNewUser({'login' => self.login, 'name' => self.name, 'email' => self.email}) end + + # Need to overwrite Authentication::ByPassword#password_required? for SONAR-4064 + def password_required? + (crypted_password.blank? && self.new_record?) || !password.blank? + end end -- 2.39.5