Added exclusion of cancelled session when doing audio file import. Fixes an server 500 error when a cancelled session is shown in the same room and timeslot as an actual session.

- Legacy-Id: 15752
This commit is contained in:
Henrik Levkowetz 2018-11-11 14:33:45 +00:00
parent 8180716efa
commit 5cba7fc8a8

View file

@ -82,7 +82,6 @@ def import_audio_files(meeting):
if unmatched_files:
send_audio_import_warning(unmatched_files)
def get_timeslot_for_filename(filename):
'''Returns a timeslot matching the filename given.
NOTE: currently only works with ietfNN prefix (regular meetings)
@ -99,7 +98,7 @@ def get_timeslot_for_filename(filename):
location__name=room_mapping[match.groupdict()['room']],
time=time,
sessionassignments__schedule=meeting.agenda,
).distinct()
).exclude(sessions__status_id='canceled').distinct()
return slots.get()
except (ObjectDoesNotExist, KeyError):
return None