From a6721c1bac13de2a0beb7ec525c162246c6b0cc9 Mon Sep 17 00:00:00 2001 From: Marius van den Beek Date: Thu, 8 Feb 2024 12:35:25 +0100 Subject: [PATCH] Tweak SQLAlchemy usage in `get_user_data_tables` Co-authored-by: John Davis --- lib/galaxy/model/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index 04f47bf7b5f5..69927bcd0daf 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -794,11 +794,12 @@ def __init__(self, email=None, password=None, username=None): def get_user_data_tables(self, data_table: str): session = object_session(self) + assert session metadata_select = ( select(HistoryDatasetAssociation) .join(Dataset) .join(History) - .filter( + .where( HistoryDatasetAssociation.deleted == false(), HistoryDatasetAssociation.extension == "data_manager_json", History.user_id == self.id,