]> git.parisson.com Git - teleforma.git/commitdiff
Fixed bug linked to variable script numbers
authorGael Le Mignot <gael@pilotsystems.net>
Tue, 13 Nov 2018 13:24:45 +0000 (14:24 +0100)
committerGael Le Mignot <gael@pilotsystems.net>
Tue, 13 Nov 2018 13:24:45 +0000 (14:24 +0100)
teleforma/exam/views.py

index bd2b27c92789e2a85f0210b5f3e0b2b8bd3d321c..489c4225b663dff1acb86a1c2c94bb71b8fcf693 100755 (executable)
@@ -71,6 +71,12 @@ class ScriptView(ScriptMixinView, CourseAccessMixin, UpdateView):
     template_name='exam/script_detail.html'
     form_class = ScriptForm
 
+    def get_form_kwargs(self):
+        kwargs = super(ScriptView, self).get_form_kwargs()
+        script = self.get_object()
+        kwargs['period'] = script.period
+        return kwargs
+
     def get_success_url(self):
         period = Period.objects.get(id=self.kwargs['period_id'])
         return reverse_lazy('teleforma-exam-scripts-pending', kwargs={'period_id':period.id})