summaryrefslogtreecommitdiffstats
path: root/core/views/survex.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/survex.py')
-rw-r--r--core/views/survex.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/core/views/survex.py b/core/views/survex.py
index 2a750aa..5115cb7 100644
--- a/core/views/survex.py
+++ b/core/views/survex.py
@@ -344,6 +344,7 @@ def svx(request, survex_file):
# collect all the survex blocks which actually have a valid date
if svxfile:
+ has_3d = (Path(survexdatasetpath) / Path(survex_file + ".3d")).is_file()
try:
svxblocks = svxfile.survexblock_set.filter(date__isnull=False).order_by('date')
except:
@@ -353,12 +354,14 @@ def svx(request, survex_file):
svxlength = 0.0
for b in svxblocksall:
svxlength += b.legslength
- print(svxlength,b, b.legsall)
+ # print(svxlength,b, b.legsall)
except AttributeError: # some survexfiles just *include files and have no blocks themselves
svxblocksall = []
else:
svxblocks = []
svxblocksall = []
+ svxlength = 0.0
+ has_3d = False
if not difflist:
difflist = ["Survex file does not exist yet"]
@@ -368,7 +371,7 @@ def svx(request, survex_file):
vmap = {
"settings": settings,
"warning": warning,
- "has_3d": (Path(survexdatasetpath) / Path(survex_file + ".3d")).is_file(),
+ "has_3d": has_3d,
"title": survex_file,
"svxlength": svxlength,
"svxblocks": svxblocks,