From: Guillaume Pellerin Date: Fri, 22 Jan 2016 13:39:42 +0000 (+0100) Subject: quiz must be validated for seminar validation X-Git-Tag: 2.8.1-pro~242 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c9a7e929a427ae49173a0626e9ede905757432d8;p=teleforma.git quiz must be validated for seminar validation --- 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