diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-09-22 22:41:42 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-09-22 22:41:42 +0300 |
commit | aa20692ad6d1dea43d63674335c4e4dba7ae07ec (patch) | |
tree | b21c73b78a7e6d4629ed93672cee62e8094414a3 /core | |
parent | af88cb4d0faf58029a9c816e2d96d07d2e15e721 (diff) | |
download | troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.tar.gz troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.tar.bz2 troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.zip |
bugfixes and enabling older wallets to be found and listed
Diffstat (limited to 'core')
-rw-r--r-- | core/models/survex.py | 9 | ||||
-rw-r--r-- | core/views/uploads.py | 2 |
2 files changed, 8 insertions, 3 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 diff --git a/core/views/uploads.py b/core/views/uploads.py index 3773e4f..17b57cb 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -359,7 +359,7 @@ def scanupload(request, path=None): year = wallet[:4] try: - if int(year) <= 1998: + if wallet[4]!= "#": #print(f'! - FORM scanupload - start {wallet} REDIRECT TO OLDWALLET') return(oldwallet(request, path)) except: |