diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2023-02-01 19:10:46 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2023-02-01 19:10:46 +0000 |
commit | 587ccff50110804cbff356d07c56ecea72ccf1fa (patch) | |
tree | 775040f6012c9d310cf37f91a5269857766ddbdf /core/models | |
parent | 8e51f3aff859d5c45c5bfb2a159879c25dee6215 (diff) | |
download | troggle-587ccff50110804cbff356d07c56ecea72ccf1fa.tar.gz troggle-587ccff50110804cbff356d07c56ecea72ccf1fa.tar.bz2 troggle-587ccff50110804cbff356d07c56ecea72ccf1fa.zip |
date handling now working for new wallet
Diffstat (limited to 'core/models')
-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) |