From d5887e8f99116976e42336af18ad5bf674fa78a2 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 5 Mar 2023 19:53:12 +0000 Subject: [PATCH] bloody bugs --- core/views/survex.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/views/survex.py b/core/views/survex.py index 21d558e..935ecd9 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -271,17 +271,22 @@ def svx(request, survex_file): outputtype = rform.cleaned_data["outputtype"] # used by CodeMirror ajax I think difflist = form.DiffCode(rcode) # print(">>>> ", rform.data) + svxfile = form.survexfile if "revert" in rform.data: pass + if "process" in rform.data: - if not difflist: + if difflist: + message = "SAVE FILE FIRST" + form.data["code"] = rcode + elif svxfile: logmessage = form.Process() if logmessage: message = f"OUTPUT FROM PROCESSING\n{logmessage}" else: - message = "SAVE FILE FIRST" - form.data["code"] = rcode + message = "SAVE VALID FILE FIRST" + form.data["code"] = rcode if "save" in rform.data: if request.user.is_authenticated: message = form.SaveCode(rcode) @@ -293,7 +298,7 @@ def svx(request, survex_file): print("Differences: ") form.data["code"] = rcode - # process(survex_file) + # GET or after POST-specific handling svxfile = form.survexfile # only valid once form.GetDiscCode() called if "code" not in form.data: