]> git.parisson.com Git - teleforma.git/commitdiff
Rejected script are now excluded from scripts limit count
authoryleclanche <yoan.leclanche@gmail.com>
Thu, 8 Aug 2019 12:19:58 +0000 (14:19 +0200)
committeryleclanche <yoan.leclanche@gmail.com>
Thu, 8 Aug 2019 12:19:58 +0000 (14:19 +0200)
teleforma/exam/views.py

index d83aeb8d952e88e2296dabeac0446dfed49e585e..255a7b405664b9c7a0eee0abf5f72ed90c716ada 100755 (executable)
@@ -42,7 +42,8 @@ class ScriptMixinView(View):
         if getattr(settings, 'TELEFORMA_EXAM_SCRIPT_UPLOAD', True) and self.period.date_exam_end:
             upload = datetime.datetime.now() <= self.period.date_exam_end
             cur_scripts = Script.objects.filter(period = self.period,
-                                                author = self.request.user).count()
+                                                author = self.request.user)\
+                                        .exclude(status=0).count()
             allowed_scripts = self.nb_script * len(self.get_course_pk_list())
             if cur_scripts >= allowed_scripts:
                 upload = False