re-ordering middleware and logon system

This commit is contained in:
Philip Sargent
2021-03-27 18:22:07 +00:00
parent e7947069a2
commit ffaaea497c
9 changed files with 65 additions and 17 deletions

View File

@@ -34,7 +34,11 @@ def troggle404(request): # cannot get this to work. Handler404 in urls.py not ri
def showrequest(request):
return HttpResponse(request.GET)
def frontpage(request):
def frontpage(request):
'''never seen in practice'''
# bthe messages system does a popup on this page if there is a recent message, e.g. from the admin site actions.
# via django.contrib.messages.middleware.MessageMiddleware
# this is set in the templates.
if request.user.is_authenticated():
return render(request,'tasks.html')

View File

@@ -146,7 +146,7 @@ class SvxForm(forms.Form):
return "SAVED ."
def Process(self):
print("....\n\n\n....Processing\n\n\n")
print(">>>>....\n\n\n....Processing\n\n\n")
froox = os.fspath(survexdatasetpath / (self.data['filename'] + ".svx"))
froog = os.fspath(survexdatasetpath / (self.data['filename'] + ".log"))
cwd = os.getcwd()
@@ -184,7 +184,7 @@ def svx(request, survex_file):
rcode = rform.cleaned_data['code']
outputtype = rform.cleaned_data['outputtype']
difflist = form.DiffCode(rcode)
#print("ssss ", rform.data)
#print(">>>> ", rform.data)
if "revert" in rform.data:
pass
@@ -225,7 +225,7 @@ def svx(request, survex_file):
'difflist': difflist,
'logmessage':logmessage,
'form':form}
vmap.update(csrf(request))
# vmap.update(csrf(request)) # this now refreshes to the wrong value, now that we user render(request,
if outputtype == "ajax":
return render(request, 'svxfiledifflistonly.html', vmap)
@@ -331,7 +331,7 @@ def survexcaveslist(request):
arealist = sorted([ (area, -int(re.match(r"\d*", f).group(0) or "0"), f) for f in os.listdir(cavesdir) ])
fnumlist += arealist
print(fnumlist)
#print(fnumlist)
# go through the list and identify the contents of each cave directory
for area, num, cavedir in fnumlist: