]> git.parisson.com Git - teleforma.git/commitdiff
fix issue when no seminar in testimonial
authorYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 20 Mar 2024 12:42:02 +0000 (13:42 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Wed, 20 Mar 2024 12:42:02 +0000 (13:42 +0100)
teleforma/management/commands/teleforma-export-avis.py

index cb090d81f683438a711bd771c2841f5a8826871f..6351944469dc5f4c02baba5b8ed8c0aa3b25cbd3 100644 (file)
@@ -68,7 +68,10 @@ class Command(BaseCommand):
         for testimonial in testimonials:
             user = testimonial.user
             seminar = testimonial.seminar
-            if testimonial.seminar.course.code == "demo":
+            if not seminar:
+                continue
+            
+            if seminar.course.code == "demo":
                 continue
             # https://mattermost.pilotsystems.net/pro-barreau/pl/twdx8ro6mfbimyr7n31tkpstac
             # testimonials are created before being accessible