From a280f1a969ec9de49952c0007f93a79edac02604 Mon Sep 17 00:00:00 2001 From: guerler Date: Fri, 8 Dec 2023 11:24:36 +0300 Subject: [PATCH] Allow purge to supersede deleted in user grid query --- lib/galaxy/webapps/galaxy/controllers/admin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/webapps/galaxy/controllers/admin.py b/lib/galaxy/webapps/galaxy/controllers/admin.py index 464242905035..ca634743daf0 100644 --- a/lib/galaxy/webapps/galaxy/controllers/admin.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin.py @@ -129,6 +129,7 @@ def apply_query_filter(self, query, **kwargs): "is": "is", } deleted = False + purged = False search_query = kwargs.get("search") if search_query: parsed_search = parse_filters_structured(search_query, INDEX_SEARCH_FILTERS) @@ -144,7 +145,7 @@ def apply_query_filter(self, query, **kwargs): if q == "deleted": deleted = True elif q == "purged": - query = query.filter(self.model_class.purged == true()) + purged = True elif isinstance(term, RawTextTerm): query = query.filter( raw_text_column_filter( @@ -155,7 +156,10 @@ def apply_query_filter(self, query, **kwargs): term, ) ) - query = query.filter(self.model_class.deleted == (true() if deleted else false())) + if purged: + query = query.filter(self.model_class.purged == true()) + else: + query = query.filter(self.model_class.deleted == (true() if deleted else false())) return query