From: yleclanche Date: Thu, 8 Aug 2019 12:19:58 +0000 (+0200) Subject: Rejected script are now excluded from scripts limit count X-Git-Tag: 1.4.1~19 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=e898ed8004390a3ddcd3a2e3766079a530ab8d79;p=teleforma.git Rejected script are now excluded from scripts limit count --- 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