mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 00:27:07 +00:00
fixes for crashes,svx files in wallets
This commit is contained in:
@@ -281,19 +281,24 @@ class Wallet(models.Model):
|
||||
waldata["survex file"] = [waldata["survex file"]]
|
||||
ngood = 0
|
||||
nbad = 0
|
||||
ticks["S"] = "black"
|
||||
for svx in waldata["survex file"]:
|
||||
if svx !="":
|
||||
if (Path(settings.SURVEX_DATA) / svx).is_file():
|
||||
ticks["S"] = "purple"
|
||||
for sx in waldata["survex file"]:
|
||||
#this logic appears in several places, inc uploads.py). Refactor.
|
||||
if sx !="":
|
||||
if Path(sx).suffix.lower() != ".svx":
|
||||
sx = sx + ".svx"
|
||||
if (Path(settings.SURVEX_DATA) / sx).is_file():
|
||||
ngood += 1
|
||||
else:
|
||||
nbad += 1
|
||||
if nbad == 0 and ngood >= 1:
|
||||
ticks["S"] = "green"
|
||||
if nbad >= 1 and ngood >= 1:
|
||||
elif nbad >= 1 and ngood >= 1:
|
||||
ticks["S"] = "orange"
|
||||
if nbad >= 1 and ngood == 0:
|
||||
elif nbad >= 1 and ngood == 0:
|
||||
ticks["S"] = "red"
|
||||
else:
|
||||
ticks["S"] = "black"
|
||||
|
||||
# Cave Description
|
||||
if waldata["description written"]:
|
||||
|
||||
Reference in New Issue
Block a user