From: Yoan Le Clanche Date: Wed, 20 Mar 2024 12:42:02 +0000 (+0100) Subject: fix issue when no seminar in testimonial X-Git-Tag: 2.8.1-pro~18 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=611a58773a8fd664351339b7b89d2b2d5d7dac2d;p=teleforma.git fix issue when no seminar in testimonial --- 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