2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

obviate meaningless error messages

This commit is contained in:
Philip Sargent 2023-03-18 20:32:35 +00:00
parent 5a90e7b727
commit 9489b9209d

View File

@ -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: