Added a guard against trying to list locations which are None in agenda.json (there are socials with a timeslot but no location)

- Legacy-Id: 13482
This commit is contained in:
Henrik Levkowetz 2017-06-01 07:44:18 +00:00
parent b81be04f20
commit ecb0e75e4d

View file

@ -960,7 +960,8 @@ def json_agenda(request, num=None ):
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
locations.add(asgn.timeslot.location)
if asgn.timeslot.location: # Some socials have an assignment but no location
locations.add(asgn.timeslot.location)
if asgn.session.agenda():
sessdict['agenda'] = asgn.session.agenda().href()