2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 05:37:14 +00:00

Entrances now do cookie / git author thing. + tidyup.

This commit is contained in:
2024-12-28 23:49:26 +00:00
parent e7444d20a4
commit dac3e6e288
7 changed files with 43 additions and 24 deletions

View File

@@ -324,8 +324,9 @@ def svx(request, survex_file):
if request.method == "POST": # If the form has been submitted...
rform = SvxForm(request.POST) #
if rform.is_valid(): # All validation rules pass (how do we check it against the filename and users?)
if rform.is_valid(): # All Django syntax validation rules pass (how do we check it against a valid filename and users?)
editor = rform.cleaned_data["who_are_you"]
editor = git_string(editor)
rcode = rform.cleaned_data["code"]
outputtype = rform.cleaned_data["outputtype"] # used by CodeMirror ajax I think
difflist = form.DiffCode(rcode)
@@ -352,9 +353,8 @@ def svx(request, survex_file):
if "save" in rform.data:
if request.user.is_authenticated:
if difflist:
editor = rform.cleaned_data["who_are_you"]
print(f"Saving code and editor id {editor=}")
message = form.SaveCode(rcode, editor)
message = form.SaveCode(rcode, editor) # saves file and does git thing
else:
message = "NO DIFFERENCES - so not saving the file"
else: