From: Gael Le Mignot Date: Tue, 13 Nov 2018 13:24:45 +0000 (+0100) Subject: Fixed bug linked to variable script numbers X-Git-Tag: 1.4.0~27 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bdfd558064641583163297a13cb2e78ceb18a844;p=teleforma.git Fixed bug linked to variable script numbers --- diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index bd2b27c9..489c4225 100755 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -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})