summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2018-09-12 20:52:30 +0000
committerRobert Speicher <robert@gitlab.com>2018-09-12 20:52:30 +0000
commitd2cc536d6aa79f697ff70d74fc13bbeb36fd43dc (patch)
tree467b5f55fe9b757959c1e5bd4c281beff163ac14 /lib/api
parentfb81210ba7079ede4451d979b8da92fcdf04a17c (diff)
parent8e52f56d8d1a041716d4ebcf8a42934825a921af (diff)
downloadgitlab-ce-d2cc536d6aa79f697ff70d74fc13bbeb36fd43dc.tar.gz
Merge branch '50678-ignores-project-pending-delete' into 'master'
Resolve "500 Internal Server Error: Deleting branch of deleted project" Closes #50678 See merge request gitlab-org/gitlab-ce!21542
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/helpers.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 5505d7a7b08..c7ecddeccf0 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -103,10 +103,12 @@ module API
end
def find_project(id)
+ projects = Project.without_deleted
+
if id.is_a?(Integer) || id =~ /^\d+$/
- Project.find_by(id: id)
+ projects.find_by(id: id)
elsif id.include?("/")
- Project.find_by_full_path(id)
+ projects.find_by_full_path(id)
end
end
@@ -386,7 +388,7 @@ module API
end
def project_finder_params
- finder_params = {}
+ finder_params = { without_deleted: true }
finder_params[:owned] = true if params[:owned].present?
finder_params[:non_public] = true if params[:membership].present?
finder_params[:starred] = true if params[:starred].present?