summaryrefslogtreecommitdiffstats
path: root/core/models/wallets.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-03-18 20:32:35 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2023-03-18 20:32:35 +0000
commit9489b9209d7704992753c778b430eb3e2c2c7a6c (patch)
tree68ae3388b8ed5801502452cfe07712189caaf30f /core/models/wallets.py
parent5a90e7b727bd224bea05bbdafe7031c3f4356dc0 (diff)
downloadtroggle-9489b9209d7704992753c778b430eb3e2c2c7a6c.tar.gz
troggle-9489b9209d7704992753c778b430eb3e2c2c7a6c.tar.bz2
troggle-9489b9209d7704992753c778b430eb3e2c2c7a6c.zip
obviate meaningless error messages
Diffstat (limited to 'core/models/wallets.py')
-rw-r--r--core/models/wallets.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/models/wallets.py b/core/models/wallets.py
index 551e3e1..10ef3db 100644
--- a/core/models/wallets.py
+++ b/core/models/wallets.py
@@ -44,9 +44,13 @@ class Wallet(models.Model):
wyear = fp.parent.name
wurl = f"/walletedit/{self.walletname}" # .replace('#', ':')
+ if len(wyear) != 4 or len(wname) !=6:
+ # no contents.json for old-style wallets
+ return None
+
jsonfile = Path(settings.DRAWINGS_DATA, "walletjson") / wyear / wname / "contents.json"
if not Path(jsonfile).is_file():
- print(f'{jsonfile} is not a file')
+ print(f'{jsonfile} is not a file {wyear=} {wname=} ')
return None
else:
with open(jsonfile) as json_f: