From 5a1fc4c2abdaf12cf6f38982afd488ae1acbedb7 Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Mon, 12 Dec 2022 18:33:08 -0400 Subject: [PATCH] fix: use a single Meeting instance for all assignments in agenda views (#4877) --- ietf/meeting/helpers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ietf/meeting/helpers.py b/ietf/meeting/helpers.py index 96143076b..256d10fb7 100644 --- a/ietf/meeting/helpers.py +++ b/ietf/meeting/helpers.py @@ -119,6 +119,11 @@ def preprocess_assignments_for_agenda(assignments_queryset, meeting, extra_prefe groups = [ ] for a in assignments: if a.session: + # Ensure that all Sessions refer to the same Meeting instance so they can share the + # _groups_at_the_time() cache. The Sessions should all belong to the same meeting, but + # check before blindly assigning to meeting just in case. + if a.session.meeting.pk == meeting.pk: + a.session.meeting = meeting a.session.order_number = None if a.session.group and a.session.group not in groups: