]> git.parisson.com Git - teleforma.git/commitdiff
fix seminar copy
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 18 Dec 2014 08:44:23 +0000 (09:44 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 18 Dec 2014 08:44:23 +0000 (09:44 +0100)
teleforma/management/commands/teleforma-copy-seminars.py

index 4134258a95ed4442ee661bc21cc787944b8122ed..0f2dcb710efa7fb53466a84e95b45e5b1d94cfbf 100644 (file)
@@ -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()
-