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

stop crash on live system

This commit is contained in:
Philip Sargent 2023-07-14 11:21:49 +02:00
parent 387bdf4f91
commit 4e4824546a

View File

@ -53,6 +53,7 @@ class Wallet(models.Model):
jsonfile = Path(settings.DRAWINGS_DATA, "walletjson") / wyear / wname / "contents.json"
if not Path(jsonfile).is_file():
print(f'{jsonfile} is not a file {wyear=} {wname=} ')
# Should this be a DataIssue?
return None
else:
with open(jsonfile) as json_f:
@ -60,8 +61,9 @@ class Wallet(models.Model):
waldata = json.load(json_f)
except:
message = f"! {str(self.walletname)} Failed to load {jsonfile} JSON file"
# print(message)
raise
print(message)
# Should this be a DataIssue?
return None
if waldata["date"]:
datestr = waldata["date"].replace(".", "-")
try: