diff options
author | Jan <king-jan1999@hotmail.de> | 2018-03-26 09:22:03 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-03-26 09:22:03 +0000 |
commit | 54baf3a362e853f3d704b6936fb7a2c4aebd5956 (patch) | |
tree | a27b51b35411c887d8d5965f533fd83444a1d9b9 /lib/api/projects.rb | |
parent | bf2727564800adc5b2a7c31a7e8241a392fc673d (diff) | |
download | gitlab-ce-54baf3a362e853f3d704b6936fb7a2c4aebd5956.tar.gz |
Resolve "Forking with namespace doesn't work (API)"
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index b552b0e0c5d..467bc78dad8 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -228,11 +228,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') |