mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 03:17:12 +00:00
date handling now working for new wallet
This commit is contained in:
@@ -13,6 +13,7 @@ from django.urls import reverse
|
||||
# from troggle.core.models.survex import SurvexBlock
|
||||
# from troggle.core.models.troggle import DataIssue # circular import. Hmm
|
||||
|
||||
YEAR_RANGE = (1975, 2050)
|
||||
|
||||
class Wallet(models.Model):
|
||||
"""We do not keep the JSON values in the database, we query them afresh each time,
|
||||
@@ -88,7 +89,8 @@ class Wallet(models.Model):
|
||||
if self.walletname[4] != "#":
|
||||
return None
|
||||
year = int(self.walletname[0:4])
|
||||
if year < 1975 or year > 2050:
|
||||
ymin, ymax = YEAR_RANGE
|
||||
if year < ymin or year > ymax:
|
||||
return None
|
||||
else:
|
||||
self.walletyear = datetime.date(year, 1, 1)
|
||||
|
||||
Reference in New Issue
Block a user