summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
author🙈 jacopo beschi 🙉 <intrip@gmail.com>2018-09-12 20:52:30 +0000
committerRobert Speicher <robert@gitlab.com>2018-09-12 20:52:30 +0000
commit8e52f56d8d1a041716d4ebcf8a42934825a921af (patch)
tree467b5f55fe9b757959c1e5bd4c281beff163ac14 /app
parentfb81210ba7079ede4451d979b8da92fcdf04a17c (diff)
downloadgitlab-ce-8e52f56d8d1a041716d4ebcf8a42934825a921af.tar.gz
Resolve "500 Internal Server Error: Deleting branch of deleted project"
Diffstat (limited to 'app')
-rw-r--r--app/finders/projects_finder.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb
index cac6643eff3..0398ccce93b 100644
--- a/app/finders/projects_finder.rb
+++ b/app/finders/projects_finder.rb
@@ -49,6 +49,7 @@ class ProjectsFinder < UnionFinder
collection = by_search(collection)
collection = by_archived(collection)
collection = by_custom_attributes(collection)
+ collection = by_deleted_status(collection)
sort(collection)
end
@@ -131,6 +132,10 @@ class ProjectsFinder < UnionFinder
params[:search].present? ? items.search(params[:search]) : items
end
+ def by_deleted_status(items)
+ params[:without_deleted].present? ? items.without_deleted : items
+ end
+
def sort(items)
params[:sort].present? ? items.sort_by_attribute(params[:sort]) : items.order_id_desc
end