diff options
Diffstat (limited to 'core/models/wallets.py')
-rw-r--r-- | core/models/wallets.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/models/wallets.py b/core/models/wallets.py index 19eaec5..7c0dea4 100644 --- a/core/models/wallets.py +++ b/core/models/wallets.py @@ -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) |