diff options
author | Robert Speicher <robert@gitlab.com> | 2017-04-27 20:41:16 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-04-27 20:41:16 +0000 |
commit | fd31d6a3f8f3109697e9810cdd56ad04ceb1671f (patch) | |
tree | b57e6e584aeb13d578daecc3071c8c0ce09df1e5 /app | |
parent | c4209bcc776b0af6bc697a069e08368d445dcc9e (diff) | |
parent | b9e573db5707a8921699a3035d73d5b621cbcdcd (diff) | |
download | gitlab-ce-fd31d6a3f8f3109697e9810cdd56ad04ceb1671f.tar.gz |
Merge branch 'dm-fix-ghost-user-validation' into 'master'
Skip validation when creating internal (ghost, service desk) users
See merge request !10949
Diffstat (limited to 'app')
-rw-r--r-- | app/models/user.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 774d4caa806..bd9c9f99663 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1068,11 +1068,13 @@ class User < ActiveRecord::Base User.find_by_email(s) end - scope.create( + user = scope.build( username: username, email: email, &creation_block ) + user.save(validate: false) + user ensure Gitlab::ExclusiveLease.cancel(lease_key, uuid) end |