summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-09-05 13:29:49 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-09-05 13:29:49 +0300
commitf3d5a389eb8a510366ea68d6e6e9762ce024248c (patch)
tree35e8b1d5d432b7ef8a7d1a8fa4e3c750d367fd2c
parent2506517e179177b8a35caa4c1e562438a037809c (diff)
downloadtroggle-f3d5a389eb8a510366ea68d6e6e9762ce024248c.tar.gz
troggle-f3d5a389eb8a510366ea68d6e6e9762ce024248c.tar.bz2
troggle-f3d5a389eb8a510366ea68d6e6e9762ce024248c.zip
hide warning msgs about pre 1999 wallets
-rw-r--r--core/models/wallets.py26
1 files changed, 21 insertions, 5 deletions
diff --git a/core/models/wallets.py b/core/models/wallets.py
index e0f4b00..3a05737 100644
--- a/core/models/wallets.py
+++ b/core/models/wallets.py
@@ -56,9 +56,24 @@ def make_valid_date(date):
print(f"! - Failed to understand date, none of our tricks worked {datestr=} ")
return None
+archaic_wallets = [
+ '1984AndysNotebook',
+ '1984BrownLandscapeNotebook',
+ '1989LUSS',
+ '1989surveybook',
+ '1990Surveybookkh',
+ '1991surveybook',
+ '1992-94Surveybookkh',
+ '1994',
+ '1995-96kh',
+ '1996-1999NotKHbook',
+ '1997-99kh',
+ '1999',
+ 'loosepages',
+ ]
class Wallet(models.Model):
"""We do not keep the JSON values in the database, we query them afresh each time,
- but we will change this when we need to do a Django query on e.g. personame
+ but we may change this if we need to do a Django query on e.g. personame
"""
fpath = models.CharField(max_length=200)
@@ -95,10 +110,11 @@ class Wallet(models.Model):
jsonfile = Path(settings.DRAWINGS_DATA, "walletjson") / wyear / wname / "contents.json"
if not Path(jsonfile).is_file():
- message = f"! {jsonfile} is not a file {wyear=} {wname=} "
- from troggle.core.models.troggle import DataIssue
- print(message)
- DataIssue.objects.update_or_create(parser="wallets", message=message, url=wurl)
+ if wname not in archaic_wallets:
+ message = f"! {jsonfile} is not a file {wyear=} {wname=} "
+ print(message)
+ from troggle.core.models.troggle import DataIssue
+ DataIssue.objects.update_or_create(parser="wallets", message=message, url=wurl)
return None
else:
with open(jsonfile) as json_f: