From 4e4824546ac32f47670bf8050481706c486b65e9 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 14 Jul 2023 11:21:49 +0200 Subject: [PATCH] stop crash on live system --- core/models/wallets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/models/wallets.py b/core/models/wallets.py index 6d217c6..9da5695 100644 --- a/core/models/wallets.py +++ b/core/models/wallets.py @@ -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: