Revert the removal of the decoration of session with order_number made in r19074. The attribute is used in the templated URLs associated with Rooms (such as for the Meetecho session URL). Commit ready for merge.

- Legacy-Id: 19168
This commit is contained in:
Robert Sparks 2021-06-30 18:07:52 +00:00
parent 058f007502
commit 0d33a8dde2
2 changed files with 6 additions and 0 deletions
ietf/meeting

View file

@ -194,6 +194,7 @@ def preprocess_assignments_for_agenda(assignments_queryset, meeting, extra_prefe
for a in assignments:
if a.session:
a.session.historic_group = None
a.session.order_number = None
if a.session.group and a.session.group not in groups:
groups.append(a.session.group)
@ -216,6 +217,9 @@ def preprocess_assignments_for_agenda(assignments_queryset, meeting, extra_prefe
if a.session.historic_group.parent_id:
parent_id_set.add(a.session.historic_group.parent_id)
l = sessions_for_groups.get((a.session.group, a.session.type_id), [])
a.session.order_number = l.index(a) + 1 if a in l else 0
parents = Group.objects.filter(pk__in=parent_id_set)
parent_replacements = find_history_replacements_active_at(parents, meeting_time)

View file

@ -2305,6 +2305,8 @@ def session_details(request, num, acronym):
qs = [p for p in qs if p.document.get_state_slug(p.document.type_id)!='deleted']
session.type_counter.update([p.document.type.slug for p in qs])
session.order_number = session.order_in_meeting()
# we somewhat arbitrarily use the group of the last session we get from
# get_sessions() above when checking can_manage_session_materials()
can_manage = can_manage_session_materials(request.user, session.group, session)