From: Guillaume Pellerin Date: Fri, 20 Dec 2013 16:38:16 +0000 (+0100) Subject: add period when copy X-Git-Tag: 2.8.1-pro~395 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=858c6ed4a291f4959c89c4a6ab8692154df73be3;p=teleforma.git add period when copy --- diff --git a/teleforma/management/commands/teleforma-copy-seminars.py b/teleforma/management/commands/teleforma-copy-seminars.py index d0e2d71c..adb8e8ab 100644 --- a/teleforma/management/commands/teleforma-copy-seminars.py +++ b/teleforma/management/commands/teleforma-copy-seminars.py @@ -30,9 +30,12 @@ class Command(BaseCommand): if seminar.expiry_date: if seminar.expiry_date.year == from_year: print ("seminar cloning:", seminar) + seminar.period = from_period + seminar.save() clone = seminar.clone() clone.publish_date = seminar.publish_date.replace(year=to_year) clone.expiry_date = seminar.expiry_date.replace(year=to_year) + clone.period = to_period clone.save() print ('seminar dates updated', clone) @@ -57,3 +60,9 @@ class Command(BaseCommand): question_clone.seminar = clone question_clone.save() print ("question cloned and assigned:", question_clone) + + else: + seminar.period = to_period + seminar.save() + +