]> git.parisson.com Git - teleforma.git/commitdiff
Merge branch 'prodev' of git.parisson.com:git/teleforma into prodev
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 30 Sep 2020 10:30:22 +0000 (12:30 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 30 Sep 2020 10:30:22 +0000 (12:30 +0200)
Conflicts:
teleforma/management/commands/teleforma-copy-seminars.py

1  2 
teleforma/management/commands/teleforma-copy-seminars.py

index 3fed3de6a365544ddd18641cabd7bd5dcdcce4f6,fb03eb67f2b618decd8af2a8301cc531fe14fd55..4d50fdc8fb859f9bf8e89df07f336ab0fbf64dfb
@@@ -50,13 -50,12 +50,12 @@@ class Command(BaseCommand)
              if seminar.expiry_date:
                  if seminar.period == from_period and not seminar.code in self.less:
                      clone = seminar.clone()
 -                    try:
 -                        clone.publish_date = seminar.publish_date.replace(year=to_year)
 -                    except ValueError:
 -                        # probably a 29th of february
 -                        clone.publish_date = seminar.publish_date.replace(day=28, year=to_year)
 -                    clone.expiry_date = seminar.expiry_date.replace(year=to_year)
 +                    clone.publish_date = seminar.publish_date.replace(year=to_year)
-                     print(seminar.expiry_date)
 +                    if seminar.expiry_date.month == 2 and seminar.expiry_date.day == 29:
 +                        clone.expiry_date = seminar.expiry_date.replace(day=28)
 +                        clone.expiry_date = clone.expiry_date.replace(year=to_year)
 +                    else:
 +                        clone.expiry_date = seminar.expiry_date.replace(year=to_year)
                      clone.date_forced = datetime.datetime(to_year, 1, 1)
                      clone.period = to_period
                      clone.status = 1