From c9a7e929a427ae49173a0626e9ede905757432d8 Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Fri, 22 Jan 2016 14:39:42 +0100 Subject: [PATCH] quiz must be validated for seminar validation --- teleforma/context_processors.py | 3 ++- teleforma/views/pro.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/teleforma/context_processors.py b/teleforma/context_processors.py index 49edb4c7..fb84e5e1 100644 --- a/teleforma/context_processors.py +++ b/teleforma/context_processors.py @@ -68,7 +68,8 @@ def seminar_progress(user, seminar): def seminar_validated(user, seminar): validated = [] questions = seminar.question.filter(status=3) - if questions: + quiz_validations = QuizValidation.objects.filter(user=user, quiz=seminar.quiz, validated=True) + if questions and quiz_validations: for question in questions: answers = Answer.objects.filter(question=question, user=user, validated=True, treated=True) diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 70cc42b3..3199f12a 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -170,8 +170,8 @@ class SeminarView(SeminarAccessMixin, DetailView): seminar = context['seminar'] user = self.request.user - progress = seminar_progress(user, seminar) validated = seminar_validated(user, seminar) + progress = seminar_progress(user, seminar) context['seminar_progress'] = progress context['seminar_validated'] = validated -- 2.39.5