diff options
author | 🙈 jacopo beschi 🙉 <intrip@gmail.com> | 2018-09-12 23:52:30 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2018-09-12 23:52:30 +0300 |
commit | 8e52f56d8d1a041716d4ebcf8a42934825a921af (patch) | |
tree | 467b5f55fe9b757959c1e5bd4c281beff163ac14 /lib/api | |
parent | fb81210ba7079ede4451d979b8da92fcdf04a17c (diff) |
Resolve "500 Internal Server Error: Deleting branch of deleted project"
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/helpers.rb | 8 |
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? |