Merge branch 'namespace-validation' into 'master'

Check all namespaces on validation of new username.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/24519 and https://gitlab.com/gitlab-org/gitlab-ce/issues/24580

See merge request !7537
This commit is contained in:
Rémy Coutable 2016-11-18 09:54:16 +00:00
commit e252ee5bbf
2 changed files with 5 additions and 1 deletions

View File

@ -86,7 +86,7 @@ class UsersController < ApplicationController
end
def exists
render json: { exists: Namespace.where(path: params[:username].downcase).any? }
render json: { exists: !!Namespace.find_by_path_or_name(params[:username]) }
end
private

View File

@ -0,0 +1,4 @@
---
title: Check all namespaces on validation of new username.
merge_request: 7537
author: