mirror of https://gitlab.crans.org/bde/nk20
Compare commits
2 Commits
3f09d991f7
...
14474d309b
Author | SHA1 | Date |
---|---|---|
korenstin | 14474d309b | |
korenstin | 12c93ff9da |
|
@ -295,7 +295,14 @@ class Club(models.Model):
|
||||||
|
|
||||||
today = datetime.date.today()
|
today = datetime.date.today()
|
||||||
|
|
||||||
while (today - self.membership_start).days >= 365:
|
# Avoid any problems on February 29
|
||||||
|
if self.membership_start.month == 2 and self.membership_start.day == 29:
|
||||||
|
self.membership_start -= datetime.timedelta(days=1)
|
||||||
|
if self.membership_end.month == 2 and self.membership_end.day == 29:
|
||||||
|
self.membership_end += datetime.timedelta(days=1)
|
||||||
|
|
||||||
|
while today >= datetime.date(self.membership_start.year + 1,
|
||||||
|
self.membership_start.month, self.membership_start.day):
|
||||||
if self.membership_start:
|
if self.membership_start:
|
||||||
self.membership_start = datetime.date(self.membership_start.year + 1,
|
self.membership_start = datetime.date(self.membership_start.year + 1,
|
||||||
self.membership_start.month, self.membership_start.day)
|
self.membership_start.month, self.membership_start.day)
|
||||||
|
|
Loading…
Reference in New Issue