summaryrefslogtreecommitdiffstats
path: root/core/models/wallets.py
diff options
context:
space:
mode:
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: