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,