From 5dddf812434b747db646a5479c7814c4efdd3599 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 13 Jul 2015 12:51:32 +0200 Subject: [PATCH] change default doc type number to ID --- teleforma/exam/context_processors.py | 1 + teleforma/exam/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/teleforma/exam/context_processors.py b/teleforma/exam/context_processors.py index 4469d5f9..c547afe1 100644 --- a/teleforma/exam/context_processors.py +++ b/teleforma/exam/context_processors.py @@ -42,6 +42,7 @@ def exam_access(request): if user.is_authenticated(): students = user.student.all() quotas = user.quotas.all() + professor = user.professor.all() # Option for restricting access to platform user only if students: diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index d101ad06..c5eb2e87 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -28,7 +28,7 @@ class ScriptView(CourseAccessMixin, UpdateView): context['mark_fields'] = ['score', 'comments' ] context['reject_fields'] = ['reject_reason' ] - doc_type = DocumentType.objects.get(number=settings.TELEFORMA_EXAM_TOPIC_DEFAULT_DOC_TYPE_NUMBER) + doc_type = DocumentType.objects.get(id=settings.TELEFORMA_EXAM_TOPIC_DEFAULT_DOC_TYPE_ID) topics = Document.objects.filter(course=script.course, period=script.period, session=script.session, type=doc_type) topic = None -- 2.39.5