diff --git a/lib/galaxy/managers/pages.py b/lib/galaxy/managers/pages.py index 101d785c688e..334c968f4651 100644 --- a/lib/galaxy/managers/pages.py +++ b/lib/galaxy/managers/pages.py @@ -18,6 +18,7 @@ import sqlalchemy from sqlalchemy import ( + and_, desc, false, func, @@ -168,6 +169,10 @@ def index_query( stmt = stmt.outerjoin(self.model_class.users_shared_with) stmt = stmt.where(or_(*filters)) + # Do not include pages authored by deleted users + if show_published: + stmt = stmt.join(Page.user).where(and_(User.deleted == false(), User.purged == false())) + if payload.user_id: stmt = stmt.where(self.model_class.user_id == payload.user_id)