From c521536117e1624118699651d8a08d30f3a2b9ba 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,