summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2016-07-19 22:14:42 +0100
committerLuke Bennett <lukeeeebennettplus@gmail.com>2016-08-20 17:07:50 +0100
commita827acb281e67669f131ce95a45ceca56e0699ea (patch)
tree357013aa1341bc4393be196542412e66e66804a7
parentcb6a2e534ea07fb1bf1e376abecba2fa989f0d31 (diff)
downloadgitlab-ce-a827acb281e67669f131ce95a45ceca56e0699ea.tar.gz
altered the exists action to avoid 404ing
-rw-r--r--app/controllers/users_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 7ce4a75ffc1..6931a553205 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -1,6 +1,6 @@
class UsersController < ApplicationController
skip_before_action :authenticate_user!
- before_action :user
+ before_action :user, except: [:exists]
before_action :authorize_read_user!, only: [:show]
def show
@@ -86,7 +86,7 @@ class UsersController < ApplicationController
end
def exists
- render json: { exists: !user.nil? }
+ render json: { exists: !User.find_by_username(params[:username]).nil? }
end
private