From e8acb87fe4f8fb0191ff9754df1481cdb6c4de6d Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 13 Jul 2015 22:25:30 +0200 Subject: [PATCH] fix no quotas.script_type --- teleforma/exam/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index 99618903..fdb224e2 100644 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -265,7 +265,7 @@ class Script(BaseResource): @property def box_user_url(self): - user = {'id': 2, 'name': 'Pierre Durand'} + user = {'id': 3, 'name': 'TeleForma'} session_key = crocodoc.session.create(self.box_uuid, editable=False, user=user, filter='all', admin=False, downloadable=True, copyprotected=False, demo=False, sidebar='invisible') @@ -276,6 +276,9 @@ class Script(BaseResource): quotas = self.course.quotas.filter(date_start__lte=self.date_submitted, date_end__gte=self.date_submitted, script_type=self.type) + if not quotas: + quotas = self.course.quotas.filter(date_start__lte=self.date_submitted, + date_end__gte=self.date_submitted) if quotas: for quota in quotas: if quota.value: -- 2.39.5