]> git.parisson.com Git - teleforma.git/commitdiff
fix no testimonial seminar
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 3 Jan 2017 12:58:39 +0000 (13:58 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Tue, 3 Jan 2017 12:58:39 +0000 (13:58 +0100)
teleforma/views/pro.py

index ca5702461da354f90f42349a02e8829eca7dd090..8804d141212b76c46f8c9a77a5220800d6250dbc 100644 (file)
@@ -725,9 +725,10 @@ class TestimonialListView(ListView):
         user = self.request.user
         testimonials = Testimonial.objects.filter(user=user)
         for testimonial in testimonials:
-            seminar = testimonial.seminar
-            if seminar_validated(user, seminar) and (get_seminar_delta(user, seminar) >= 0 or testimonial.date_added <= REVISION_DATE_FILTER):
-                t.append(testimonial)
+            if testimonial.seminar:
+                seminar = testimonial.seminar
+                if seminar_validated(user, seminar) and (get_seminar_delta(user, seminar) >= 0 or testimonial.date_added <= REVISION_DATE_FILTER):
+                    t.append(testimonial)
         return t
 
     @method_decorator(login_required)