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: