forked from expo/troggle
stop crash on live system
This commit is contained in:
parent
387bdf4f91
commit
4e4824546a
@ -53,6 +53,7 @@ class Wallet(models.Model):
|
|||||||
jsonfile = Path(settings.DRAWINGS_DATA, "walletjson") / wyear / wname / "contents.json"
|
jsonfile = Path(settings.DRAWINGS_DATA, "walletjson") / wyear / wname / "contents.json"
|
||||||
if not Path(jsonfile).is_file():
|
if not Path(jsonfile).is_file():
|
||||||
print(f'{jsonfile} is not a file {wyear=} {wname=} ')
|
print(f'{jsonfile} is not a file {wyear=} {wname=} ')
|
||||||
|
# Should this be a DataIssue?
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
with open(jsonfile) as json_f:
|
with open(jsonfile) as json_f:
|
||||||
@ -60,8 +61,9 @@ class Wallet(models.Model):
|
|||||||
waldata = json.load(json_f)
|
waldata = json.load(json_f)
|
||||||
except:
|
except:
|
||||||
message = f"! {str(self.walletname)} Failed to load {jsonfile} JSON file"
|
message = f"! {str(self.walletname)} Failed to load {jsonfile} JSON file"
|
||||||
# print(message)
|
print(message)
|
||||||
raise
|
# Should this be a DataIssue?
|
||||||
|
return None
|
||||||
if waldata["date"]:
|
if waldata["date"]:
|
||||||
datestr = waldata["date"].replace(".", "-")
|
datestr = waldata["date"].replace(".", "-")
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user