]> git.parisson.com Git - teleforma.git/commitdiff
change default doc type number to ID
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 13 Jul 2015 10:51:32 +0000 (12:51 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 13 Jul 2015 10:51:32 +0000 (12:51 +0200)
teleforma/exam/context_processors.py
teleforma/exam/views.py

index 4469d5f9d54ee252186061ad67ccb0d6ef4f9444..c547afe1218d8180fd0d0f023eef90609d80f027 100644 (file)
@@ -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:
index d101ad06689eabbb64a510ac3ba44401463e7309..c5eb2e87a61e43a7795db0e84901f653856e474a 100644 (file)
@@ -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