From: Guillaume Pellerin Date: Tue, 4 Jul 2017 22:46:59 +0000 (+0200) Subject: Add global exam param X-Git-Tag: 1.1~12 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3c7e2d3124f4634d3d95e8aecfac112ab2e9d972;p=teleforma.git Add global exam param --- diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index 8abb8dda..f2512c73 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -346,7 +346,10 @@ class ScoreCreateView(ScriptCreateView): context = super(ScriptCreateView, self).get_context_data(**kwargs) period = Period.objects.get(id=self.kwargs['period_id']) context['period'] = period - context['upload'] = datetime.datetime.now() <= period.date_exam_end + if getattr(settings, 'TELEFORMA_EXAM_SCRIPT_UPLOAD', True): + context['upload'] = datetime.datetime.now() <= period.date_exam_end + else: + context['upload'] = False context['create_fields'] = ['course', 'session', 'type', 'score' ] course_pk_list = [c['course'].id for c in get_courses(self.request.user)] context['form'].fields['course'].queryset = Course.objects.filter(pk__in=course_pk_list)