Skip to content

Commit

Permalink
Allow purge to supersede deleted in user grid query
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Dec 8, 2023
1 parent aa49769 commit a280f1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/galaxy/webapps/galaxy/controllers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand All @@ -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


Expand Down

0 comments on commit a280f1a

Please sign in to comment.