From aa6b397a09462edfc1e2b47f770610222a798eaa Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Mon, 13 Sep 2021 17:49:30 +0200 Subject: [PATCH] https://trackers.pilotsystems.net/prebarreau/0261 : still display webclass in course view when the corresponding slot is deleted --- teleforma/webclass/forms.py | 2 ++ teleforma/webclass/models.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/teleforma/webclass/forms.py b/teleforma/webclass/forms.py index c7a7bc0c..d452cada 100644 --- a/teleforma/webclass/forms.py +++ b/teleforma/webclass/forms.py @@ -36,6 +36,8 @@ class WebclassRecordsForm(Form): # for each bbb record for the current course, add an option to the field for record in records: + if not record['slot']: + continue webclass_slot = WebclassSlot.objects.get( pk=record['slot'].id) label = u"%s à %s - %s" % (record['start_date'].strftime( diff --git a/teleforma/webclass/models.py b/teleforma/webclass/models.py index 3a9281b6..a6567a27 100644 --- a/teleforma/webclass/models.py +++ b/teleforma/webclass/models.py @@ -72,7 +72,7 @@ def get_records_from_bbb(**kwargs): pk=int(recording['metadata'].get('slotid', -1))) except WebclassSlot.DoesNotExist: # this happen if the slot is deleted in django admin - continue + pass data.update({ 'period_id': int(recording['metadata'].get('periodid', -1)), 'course_id': int(recording['metadata'].get('courseid', -1)), -- 2.39.5