mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-18 05:57:11 +00:00
Bugfix for new survex file
This commit is contained in:
@@ -129,6 +129,7 @@ class SvxForm(forms.Form):
|
||||
if not fname.is_file():
|
||||
print(">>> >>> WARNING - svx file not found, showing TEMPLATE SVX", fname, flush=True)
|
||||
self.template = True
|
||||
self.survexfile = False
|
||||
return survextemplatefile
|
||||
refs = SurvexFile.objects.filter(path=self.data["filename"])
|
||||
if len(refs)==1:
|
||||
@@ -298,13 +299,17 @@ def svx(request, survex_file):
|
||||
svxincludes = re.findall(r"(?i)\*include\s+(\S+)", form.data["code"] or "")
|
||||
|
||||
svxfile = form.survexfile # only valid once form.GetDiscCode() called
|
||||
print(svxfile)
|
||||
try:
|
||||
svxblocksall = svxfile.survexblock_set.all()
|
||||
except AttributeError: # some survexfiles just *include files and have no blocks themselves
|
||||
svxblocksall = []
|
||||
|
||||
# collect all the survex blocks which actually have a valid date
|
||||
svxblocks = svxfile.survexblock_set.filter(date__isnull=False).order_by('date')
|
||||
if svxfile:
|
||||
svxblocks = svxfile.survexblock_set.filter(date__isnull=False).order_by('date')
|
||||
else:
|
||||
svxblocks = []
|
||||
|
||||
|
||||
events = events_on_dates(svxblocks)
|
||||
|
||||
Reference in New Issue
Block a user