From: Guillaume Pellerin Date: Wed, 12 Jul 2017 23:57:50 +0000 (+0200) Subject: filter allowed courses X-Git-Tag: 1.2~37 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c8dfb4c2915f62623956c11d878e80ee5beb6e83;p=teleforma.git filter allowed courses --- diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index 5f2320f4..4de61a3d 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -184,7 +184,7 @@ class ScriptCreateView(ScriptMixinView, CreateView): def get_context_data(self, **kwargs): context = super(ScriptCreateView, self).get_context_data(**kwargs) context['create_fields'] = ['course', 'session', 'type', 'file' ] - course_pk_list = [c['course'].id for c in get_courses(self.request.user) if c['course'].exam_scripts] + course_pk_list = [c['course'].id for c in get_courses(self.request.user) if c.exam_scripts] context['form'].fields['course'].queryset = Course.objects.filter(pk__in=course_pk_list) return context