Skip to content

Commit e553ff8

Browse files
committed
Added an is_bof flag to json_agenda. Also added group state information. Changed the group information to use historic information instead of current.
- Legacy-Id: 12009
1 parent fe0bc55 commit e553ff8

2 files changed

Lines changed: 19 additions & 12 deletions

File tree

ietf/group/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ def about_url(self):
5656
def interim_approval_roles(self):
5757
return list(set([ role for role in self.parent.role_set.filter(name__in=['ad', 'chair']) ]))
5858

59+
def is_bof(self):
60+
return (self.state.slug in ["bof", "bof-conc"])
61+
5962
class Meta:
6063
abstract = True
6164

@@ -91,9 +94,6 @@ def is_decendant_of(self, sought_parent):
9194
p = p.parent
9295
return False
9396

94-
def is_bof(self):
95-
return (self.state.slug in ["bof", "bof-conc"])
96-
9797
def get_chair(self):
9898
chair = self.role_set.filter(name__slug='chair')[:1]
9999
return chair and chair[0] or None

ietf/meeting/views.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -902,25 +902,32 @@ def json_agenda(request, num=None ):
902902
sessions = []
903903
room_names = set()
904904
parent_acronyms = set()
905-
for asgn in meeting.agenda.assignments.exclude(session__type__in=['lead','offagenda','break','reg']):
905+
assignments = meeting.agenda.assignments.exclude(session__type__in=['lead','offagenda','break','reg'])
906+
# Update the assignments with historic information, i.e., valid at the
907+
# time of the meeting
908+
assignments = preprocess_assignments_for_agenda(assignments, meeting)
909+
for asgn in assignments:
906910
sessdict = dict()
907911
sessdict['objtype'] = 'session'
908912
sessdict['id'] = asgn.pk
909-
if asgn.session.group:
913+
if asgn.session.historic_group:
910914
sessdict['group'] = {
911-
"acronym": asgn.session.group.acronym,
912-
"name": asgn.session.group.name,
913-
"type": asgn.session.group.type_id,
915+
"acronym": asgn.session.historic_group.acronym,
916+
"name": asgn.session.historic_group.name,
917+
"type": asgn.session.historic_group.type_id,
918+
"state": asgn.session.historic_group.state_id,
914919
}
915-
if asgn.session.group.type_id in ['wg','rg', 'ag',] or asgn.session.group.acronym in ['iesg',]:
916-
sessdict['group']['parent'] = asgn.session.group.parent.acronym
917-
parent_acronyms.add(asgn.session.group.parent.acronym)
920+
if asgn.session.historic_group.is_bof():
921+
sessdict['is_bof'] = True
922+
if asgn.session.historic_group.type_id in ['wg','rg', 'ag',] or asgn.session.historic_group.acronym in ['iesg',]:
923+
sessdict['group']['parent'] = asgn.session.historic_group.historic_parent.acronym
924+
parent_acronyms.add(asgn.session.historic_group.historic_parent.acronym)
918925
if asgn.session.name:
919926
sessdict['name'] = asgn.session.name
920927
elif asgn.session.short:
921928
sessdict['name'] = asgn.session.short
922929
else:
923-
sessdict['name'] = asgn.session.group.name
930+
sessdict['name'] = asgn.session.historic_group.name
924931
sessdict['start'] = asgn.timeslot.utc_start_time().strftime("%Y-%m-%dT%H:%M:%SZ")
925932
sessdict['duration'] = str(asgn.timeslot.duration)
926933
sessdict['location'] = asgn.room_name

0 commit comments

Comments
 (0)