From 9489b9209d7704992753c778b430eb3e2c2c7a6c Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 18 Mar 2023 20:32:35 +0000 Subject: [PATCH] obviate meaningless error messages --- core/models/wallets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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: