summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 09:09:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 09:09:42 +0000
commite4bf776a8829e5186a0f63603c0be627b891d80e (patch)
tree537fe714bd336bfee9f30b101a5072950a04a62a /lib/api
parent1635eacd2a9293cd04d21e82def6e2c14ed01242 (diff)
downloadgitlab-ce-e4bf776a8829e5186a0f63603c0be627b891d80e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/users.rb4
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)