From: Gael Le Mignot Date: Thu, 13 Jan 2022 16:49:43 +0000 (+0100) Subject: Hotfix for staff view of courses X-Git-Tag: 2.5.1~17^2 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f5f7db772e6148020d0bc4cb97bcc1b3a4aa888a;p=teleforma.git Hotfix for staff view of courses --- diff --git a/teleforma/templatetags/teleforma_tags.py b/teleforma/templatetags/teleforma_tags.py index ebff8e41..1a8e00b9 100644 --- a/teleforma/templatetags/teleforma_tags.py +++ b/teleforma/templatetags/teleforma_tags.py @@ -472,6 +472,6 @@ def course_media(context): course = context['course'] media = course.media.filter(period=context['period'], course_type=context['type']) - if not context['user'].is_staff or context['list_view']: + if not context['user'].is_staff or context.get('list_view', None): media = media.filter(is_published = True) return list(media)