diff --git a/lib/galaxy/managers/workflows.py b/lib/galaxy/managers/workflows.py index ecb0b7a719ae..e7ad9fc98413 100644 --- a/lib/galaxy/managers/workflows.py +++ b/lib/galaxy/managers/workflows.py @@ -197,6 +197,11 @@ def index_query( filters.append(StoredWorkflow.published == true()) stmt = select(StoredWorkflow) + + # Do not include workflows authored by deleted users + if show_published or show_shared: + stmt = stmt.join(StoredWorkflow.user).where(and_(User.deleted == false(), User.purged == false())) + if show_shared: stmt = stmt.outerjoin(StoredWorkflow.users_shared_with) stmt = stmt.outerjoin(StoredWorkflow.tags)