diff --git a/ietf/group/models.py b/ietf/group/models.py index 8be61f22e..bb6179677 100644 --- a/ietf/group/models.py +++ b/ietf/group/models.py @@ -56,6 +56,9 @@ class GroupInfo(models.Model): def interim_approval_roles(self): return list(set([ role for role in self.parent.role_set.filter(name__in=['ad', 'chair']) ])) + def is_bof(self): + return (self.state.slug in ["bof", "bof-conc"]) + class Meta: abstract = True @@ -91,9 +94,6 @@ class Group(GroupInfo): p = p.parent return False - def is_bof(self): - return (self.state.slug in ["bof", "bof-conc"]) - def get_chair(self): chair = self.role_set.filter(name__slug='chair')[:1] return chair and chair[0] or None diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index a74deabb8..2bde0aca2 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -902,25 +902,32 @@ def json_agenda(request, num=None ): sessions = [] room_names = set() parent_acronyms = set() - for asgn in meeting.agenda.assignments.exclude(session__type__in=['lead','offagenda','break','reg']): + assignments = meeting.agenda.assignments.exclude(session__type__in=['lead','offagenda','break','reg']) + # Update the assignments with historic information, i.e., valid at the + # time of the meeting + assignments = preprocess_assignments_for_agenda(assignments, meeting) + for asgn in assignments: sessdict = dict() sessdict['objtype'] = 'session' sessdict['id'] = asgn.pk - if asgn.session.group: + if asgn.session.historic_group: sessdict['group'] = { - "acronym": asgn.session.group.acronym, - "name": asgn.session.group.name, - "type": asgn.session.group.type_id, + "acronym": asgn.session.historic_group.acronym, + "name": asgn.session.historic_group.name, + "type": asgn.session.historic_group.type_id, + "state": asgn.session.historic_group.state_id, } - if asgn.session.group.type_id in ['wg','rg', 'ag',] or asgn.session.group.acronym in ['iesg',]: - sessdict['group']['parent'] = asgn.session.group.parent.acronym - parent_acronyms.add(asgn.session.group.parent.acronym) + if asgn.session.historic_group.is_bof(): + sessdict['is_bof'] = True + if asgn.session.historic_group.type_id in ['wg','rg', 'ag',] or asgn.session.historic_group.acronym in ['iesg',]: + sessdict['group']['parent'] = asgn.session.historic_group.historic_parent.acronym + parent_acronyms.add(asgn.session.historic_group.historic_parent.acronym) if asgn.session.name: sessdict['name'] = asgn.session.name elif asgn.session.short: sessdict['name'] = asgn.session.short else: - sessdict['name'] = asgn.session.group.name + sessdict['name'] = asgn.session.historic_group.name sessdict['start'] = asgn.timeslot.utc_start_time().strftime("%Y-%m-%dT%H:%M:%SZ") sessdict['duration'] = str(asgn.timeslot.duration) sessdict['location'] = asgn.room_name