From e898ed8004390a3ddcd3a2e3766079a530ab8d79 Mon Sep 17 00:00:00 2001 From: yleclanche Date: Thu, 8 Aug 2019 14:19:58 +0200 Subject: [PATCH] Rejected script are now excluded from scripts limit count --- teleforma/exam/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/teleforma/exam/views.py b/teleforma/exam/views.py index d83aeb8d..255a7b40 100755 --- a/teleforma/exam/views.py +++ b/teleforma/exam/views.py @@ -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 -- 2.39.5