From 611a58773a8fd664351339b7b89d2b2d5d7dac2d Mon Sep 17 00:00:00 2001 From: Yoan Le Clanche Date: Wed, 20 Mar 2024 13:42:02 +0100 Subject: [PATCH] fix issue when no seminar in testimonial --- teleforma/management/commands/teleforma-export-avis.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/teleforma/management/commands/teleforma-export-avis.py b/teleforma/management/commands/teleforma-export-avis.py index cb090d81..63519444 100644 --- a/teleforma/management/commands/teleforma-export-avis.py +++ b/teleforma/management/commands/teleforma-export-avis.py @@ -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 -- 2.39.5