summaryrefslogtreecommitdiffstats
path: root/core/models/survex.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-09-22 22:41:42 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-09-22 22:41:42 +0300
commitaa20692ad6d1dea43d63674335c4e4dba7ae07ec (patch)
treeb21c73b78a7e6d4629ed93672cee62e8094414a3 /core/models/survex.py
parentaf88cb4d0faf58029a9c816e2d96d07d2e15e721 (diff)
downloadtroggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.tar.gz
troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.tar.bz2
troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.zip
bugfixes and enabling older wallets to be found and listed
Diffstat (limited to 'core/models/survex.py')
-rw-r--r--core/models/survex.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/models/survex.py b/core/models/survex.py
index 6977cb7..1071537 100644
--- a/core/models/survex.py
+++ b/core/models/survex.py
@@ -225,6 +225,8 @@ class Wallet(models.Model):
return waldata
def year(self):
+ if len(self.walletname) < 5:
+ return None
if self.walletname[4] != "#":
return None
year = int(self.walletname[0:4])
@@ -352,8 +354,11 @@ class Wallet(models.Model):
ticks["Q"] = "green"
else:
ticks["Q"] = survexok
- if int(self.year()) < 2015:
- ticks["Q"] = "lightgrey"
+ if not self.year():
+ ticks["Q"] = "darkgrey"
+ else:
+ if int(self.year()) < 2015:
+ ticks["Q"] = "lightgrey"
# Notes, Plan, Elevation; Tunnel