From: Yoan Le Clanche Date: Mon, 13 Sep 2021 15:49:30 +0000 (+0200) Subject: https://trackers.pilotsystems.net/prebarreau/0261 : still display webclass in course... X-Git-Tag: 2.5.0~60 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=aa6b397a09462edfc1e2b47f770610222a798eaa;p=teleforma.git https://trackers.pilotsystems.net/prebarreau/0261 : still display webclass in course view when the corresponding slot is deleted --- 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)),