Skip to content

Commit

Permalink
prefetch group as well
Browse files Browse the repository at this point in the history
  • Loading branch information
felixrindt committed Jan 3, 2025
1 parent 40014c3 commit 759ee96
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ephios/core/views/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,11 @@ def get_queryset(self):
qs = qs.prefetch_related(
Prefetch(
"group_object_permission_set",
queryset=GroupObjectPermission.objects.filter(permission__codename="view_event"),
queryset=GroupObjectPermission.objects.filter(
permission__codename="view_event"
).select_related("group"),
to_attr="view_permissions",
),
Prefetch(
"view_permissions__group",
),
)
return qs

Expand Down

0 comments on commit 759ee96

Please sign in to comment.