summaryrefslogtreecommitdiff
path: root/lib/api/v3/projects.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-03-30 12:58:20 +0100
committerSean McGivern <sean@gitlab.com>2018-03-30 12:58:20 +0100
commit6412c4c54a7a824e108899a34b1ecec5cbdcec4b (patch)
treeafe9fa7485520c60d91315d8f73c6f1d64108c8c /lib/api/v3/projects.rb
parentddb23d3b2ba7c646cff6a5d21957194fc3474418 (diff)
parentfa1eabe8e82f7635f2aa51733c727728577c7644 (diff)
downloadgitlab-ce-6412c4c54a7a824e108899a34b1ecec5cbdcec4b.tar.gz
Merge branch 'master' into stuartnelson3/gitlab-ce-stn/issue-due-email
Diffstat (limited to 'lib/api/v3/projects.rb')
-rw-r--r--lib/api/v3/projects.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/api/v3/projects.rb b/lib/api/v3/projects.rb
index 7d8b1f369fe..a2df969d819 100644
--- a/lib/api/v3/projects.rb
+++ b/lib/api/v3/projects.rb
@@ -268,11 +268,7 @@ module API
namespace_id = fork_params[:namespace]
if namespace_id.present?
- fork_params[:namespace] = if namespace_id =~ /^\d+$/
- Namespace.find_by(id: namespace_id)
- else
- Namespace.find_by_path_or_name(namespace_id)
- end
+ fork_params[:namespace] = find_namespace(namespace_id)
unless fork_params[:namespace] && can?(current_user, :create_projects, fork_params[:namespace])
not_found!('Target Namespace')