]> git.parisson.com Git - teleforma.git/commitdiff
fix script submit when rejected before
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 5 Aug 2015 19:53:12 +0000 (21:53 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 5 Aug 2015 19:53:12 +0000 (21:53 +0200)
teleforma/exam/views.py

index a41b96b681200ee0b771c74ddfa425ac391701cd..3d90b46b2f8b7d28056b6e4ff579eea6f93b1a4d 100644 (file)
@@ -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'])