]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4064 No way to edit a user when its password is empty
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 15 Jan 2013 15:25:02 +0000 (16:25 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 15 Jan 2013 15:25:02 +0000 (16:25 +0100)
sonar-server/src/main/webapp/WEB-INF/app/models/user.rb

index ff6bcd6ebbcaa06d4ee2f0222274428a78878c43..829589ba362cc167bcf28b7737c3c12e289d7a35 100644 (file)
@@ -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