From: Guillaume Pellerin Date: Thu, 19 Dec 2013 15:15:33 +0000 (+0100) Subject: fix questions X-Git-Tag: 2.8.1-pro~420 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=21e9b3c6a56a122a87e2fd3dab068c8785fff736;p=teleforma.git fix questions --- diff --git a/teleforma/management/commands/teleforma-copy-seminars.py b/teleforma/management/commands/teleforma-copy-seminars.py index 9980780b..11e7715f 100644 --- a/teleforma/management/commands/teleforma-copy-seminars.py +++ b/teleforma/management/commands/teleforma-copy-seminars.py @@ -26,6 +26,7 @@ class Command(BaseCommand): for seminar in Seminar.objects.all(): if seminar.expiry_date.year == from_year: + questions = seminar.question.all() seminar.pk = None seminar.save() seminar.publish_date.replace(year=from_year) @@ -33,7 +34,7 @@ class Command(BaseCommand): seminar.save() print ("updated:", seminar) - for question in seminar.question.all(): + for question in questions: question.pk = None question.save() question.seminar = seminar