diff options
author | http://jneen.net/ <jneen@jneen.net> | 2017-02-28 13:38:01 -0800 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2017-03-09 11:49:52 -0800 |
commit | 153d3e57285f2526bc5371dc7109ac9be07ae132 (patch) | |
tree | 34b28fa0cbb54610fbc53be73d08dc09f5726cee | |
parent | 145f6fd0b9bb2428ee9f5445efe7cb0b91ca8712 (diff) | |
download | gitlab-ce-153d3e57285f2526bc5371dc7109ac9be07ae132.tar.gz |
don't require passwords for internal users
since they can't log in
-rw-r--r-- | app/models/user.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index fa6f336f6b5..d725d37a355 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -958,6 +958,14 @@ class User < ActiveRecord::Base self.admin = (new_level == 'admin') end + protected + + # override, from Devise::Validatable + def password_required? + return false if internal? + super + end + private def ci_projects_union @@ -1058,7 +1066,6 @@ class User < ActiveRecord::Base scope.create( username: username, - password: Devise.friendly_token, email: email, &creation_block ) |