From: Guillaume Pellerin Date: Wed, 5 Aug 2015 19:53:12 +0000 (+0200) Subject: fix script submit when rejected before X-Git-Tag: 1.1~185^2~17 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=209202f29574d78173904702db4c91331ad39be0;p=teleforma.git fix script submit when rejected before --- diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index a41b96b6..3d90b46b 100644 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -160,7 +160,7 @@ class ScriptCreateView(CreateView): def form_valid(self, form): scripts = Script.objects.filter(course=form.cleaned_data['course'], session=form.cleaned_data['session'], - type=form.cleaned_data['type'], author=self.request.user) + type=form.cleaned_data['type'], author=self.request.user).exclude(status=0) if scripts: messages.error(self.request, _("Error: you have already submitted a script for this session, the same course and the same type!")) return redirect('teleforma-exam-script-create', self.kwargs['period_id'])