From 4bdf3b49ea2d4b29aa0f9f44e302d97e5b6791ea Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Thu, 18 Dec 2014 09:44:23 +0100 Subject: [PATCH] fix seminar copy --- teleforma/management/commands/teleforma-copy-seminars.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/teleforma/management/commands/teleforma-copy-seminars.py b/teleforma/management/commands/teleforma-copy-seminars.py index 4134258a..0f2dcb71 100644 --- a/teleforma/management/commands/teleforma-copy-seminars.py +++ b/teleforma/management/commands/teleforma-copy-seminars.py @@ -28,11 +28,11 @@ class Command(BaseCommand): from_year = int(args[-2]) to_period, c = Period.objects.get_or_create(name=str(to_year)) from_period, c = Period.objects.get_or_create(name=str(from_year)) - + expiry_date = datetime.datetime(2014, 12, 31) for seminar in Seminar.objects.all(): if seminar.expiry_date: - if seminar.expiry_date.year == from_year \ + if seminar.expiry_date.date == expiry_date.date \ or (seminar.period == from_period and seminar.code in self.more): seminar.period = from_period seminar.save() @@ -67,8 +67,4 @@ class Command(BaseCommand): question_clone.save() # print ("question cloned and assigned:", question_clone) - else: - seminar.period = to_period - seminar.save() - -- 2.39.5