From 2bf7481cef149911a59df30c2bb76de13a890d9c Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Thu, 6 Aug 2020 12:47:05 +0000 Subject: [PATCH] Changed a list of tuples so as to always make them sortable. Fixes an issue with the session video URL API. This is the equivalent of [18340] for this API endpoint. - Legacy-Id: 18341 Note: SVN reference [18340] has been migrated to Git commit 27eab28a31b1ded243bd73af745fa38c09083829 --- ietf/meeting/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index 8e22bea8b..30dc811a7 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -3020,14 +3020,14 @@ def api_set_session_video_url(request): sessions = sessions.filter(group__acronym=acronym) if not sessions.exists(): return err(400, "No sessions found in meeting '%s' for group '%s'" % (number, acronym)) - session_times = [ (s.official_timeslotassignment().timeslot.time, s) for s in sessions if s.official_timeslotassignment() ] + session_times = [ (s.official_timeslotassignment().timeslot.time, s.id, s) for s in sessions if s.official_timeslotassignment() ] session_times.sort() item = request.POST.get('item') if not item.isdigit(): return err(400, "Expected a numeric value for 'item', found '%s'" % (item, )) n = int(item)-1 # change 1-based to 0-based try: - time, session = session_times[n] + time, __, session = session_times[n] except IndexError: return err(400, "No item '%s' found in list of sessions for group" % (item, )) url = request.POST.get('url')