From 1912fc163a5b481e009e1756f15a4822b8f131f9 Mon Sep 17 00:00:00 2001 From: Lukas Juhrich Date: Tue, 5 Sep 2023 18:42:06 +0200 Subject: [PATCH] [lib] add missing join condition to rewritten `membership` query --- pycroft/lib/membership.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pycroft/lib/membership.py b/pycroft/lib/membership.py index e84af3f82..47402dd63 100644 --- a/pycroft/lib/membership.py +++ b/pycroft/lib/membership.py @@ -191,7 +191,7 @@ def user_memberships_query( p_granted = aliased(Property) p_denied = aliased(Property) memberships = ( - memberships.join(group) + memberships.join(group, Membership.group_id == group.id) .outerjoin( p_granted, and_(p_granted.property_group_id == group.id, p_granted.granted) )