From 8914ee11f23a6295f6a362c13d27051eb43c2b86 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Mon, 1 Feb 2016 15:12:49 +0100 Subject: [PATCH] fix no quiz --- teleforma/context_processors.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/teleforma/context_processors.py b/teleforma/context_processors.py index 6a47a3a9..903bdff3 100644 --- a/teleforma/context_processors.py +++ b/teleforma/context_processors.py @@ -60,11 +60,12 @@ def seminar_progress(user, seminar): if answer: progress += question.weight - quiz_weight = 3 - quiz_validations = QuizValidation.objects.filter(user=user, quiz=seminar.quiz, validated=True) - total += quiz_weight - if quiz_validations: - progress += quiz_weight + if seminar.quiz: + quiz_weight = 3 + quiz_validations = QuizValidation.objects.filter(user=user, quiz=seminar.quiz, validated=True) + total += quiz_weight + if quiz_validations: + progress += quiz_weight if total != 0: return int(progress*100/total) -- 2.39.5