From: yomguy Date: Tue, 12 Feb 2013 11:22:34 +0000 (+0100) Subject: fix testimonial list X-Git-Tag: 0.9-probarreau~70 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=f057aac6bcfa7ee762990a979e34f0c7a820caf3;p=teleforma.git fix testimonial list --- diff --git a/teleforma/views/pro.py b/teleforma/views/pro.py index 3b6f12a8..c5e936f9 100644 --- a/teleforma/views/pro.py +++ b/teleforma/views/pro.py @@ -620,7 +620,14 @@ class TestimonialListView(ListView): template_name='teleforma/testimonials.html' def get_queryset(self): - return Testimonial.objects.filter(user=self.request.user) + t = [] + user = self.request.user + testimonials = Testimonial.objects.filter(user=user) + for testimonial in testimonials: + seminar = testimonial.seminar + if seminar_progress(user, seminar) == 100 and seminar_validated(user, seminar): + t.append(testimonial) + return t @method_decorator(login_required) def dispatch(self, *args, **kwargs):