diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 09:09:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-23 09:09:42 +0000 |
commit | e4bf776a8829e5186a0f63603c0be627b891d80e (patch) | |
tree | 537fe714bd336bfee9f30b101a5072950a04a62a /lib/api/users.rb | |
parent | 1635eacd2a9293cd04d21e82def6e2c14ed01242 (diff) | |
download | gitlab-ce-e4bf776a8829e5186a0f63603c0be627b891d80e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/users.rb')
-rw-r--r-- | lib/api/users.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 1ca222b4ed5..1694f3fe3fb 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -206,11 +206,11 @@ module API conflict!('Email has already been taken') if params[:email] && User.by_any_email(params[:email].downcase) - .where.not(id: user.id).count > 0 + .where.not(id: user.id).exists? conflict!('Username has already been taken') if params[:username] && User.by_username(params[:username]) - .where.not(id: user.id).count > 0 + .where.not(id: user.id).exists? user_params = declared_params(include_missing: false) |