From 3c7e2d3124f4634d3d95e8aecfac112ab2e9d972 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Wed, 5 Jul 2017 00:46:59 +0200 Subject: [PATCH] Add global exam param --- teleforma/exam/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.39.5