]> git.parisson.com Git - teleforma.git/commitdiff
fix testimonial list
authoryomguy <yomguy@parisson.com>
Tue, 12 Feb 2013 11:22:34 +0000 (12:22 +0100)
committeryomguy <yomguy@parisson.com>
Tue, 12 Feb 2013 11:22:34 +0000 (12:22 +0100)
teleforma/views/pro.py

index 3b6f12a8232f7b850172fdb9dd60c7aec3be42eb..c5e936f9536563a59c2372a14b0da388e98a3f01 100644 (file)
@@ -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):