Skip to content

Commit 8ae31f9

Browse files
committed
Do not list archived histories with regular histories
1 parent 86b5995 commit 8ae31f9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/galaxy/webapps/galaxy/services/histories.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ def index(
155155
raise glx_exceptions.AdminRequiredException(message)
156156
else:
157157
filters += [model.History.user == current_user]
158-
# and any sent in from the query string
158+
# exclude archived histories
159+
filters += [model.History.archived == false()]
160+
# and apply any other filters
159161
filters += self.filters.parse_filters(filter_params)
160162
order_by = self._build_order_by(filter_query_params.order)
161163

lib/galaxy_test/api/test_histories.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -815,3 +815,13 @@ def test_archiving_an_archived_history_conflicts(self):
815815

816816
archive_response = self.dataset_populator.archive_history(history_id)
817817
self._assert_status_code_is(archive_response, 409)
818+
819+
def test_archived_histories_are_not_listed_by_default(self):
820+
history_id = self.dataset_populator.new_history()
821+
archive_response = self.dataset_populator.archive_history(history_id)
822+
self._assert_status_code_is(archive_response, 200)
823+
assert archive_response.json()["archived"] is True
824+
825+
histories = self.dataset_populator.get_histories()
826+
for history in histories:
827+
assert history["id"] != history_id

0 commit comments

Comments
 (0)