mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-14 23:17:05 +00:00
Started removing foreignkeys to caves, to achieve greater flexability. Some log book entries stuff may be broken. Add ability to make new caves and entrances via website.
This commit is contained in:
@@ -128,7 +128,6 @@ def editflatpage(request, path):
|
||||
if request.method == 'POST': # If the form has been submitted...
|
||||
flatpageForm = FlatPageForm(request.POST) # A form bound to the POST data
|
||||
if flatpageForm.is_valid():# Form valid therefore write file
|
||||
f = open(filepath, "w")
|
||||
if filefound:
|
||||
headmatch = re.match(r"(.*)<title>.*</title>(.*)", head, re.DOTALL + re.IGNORECASE)
|
||||
if headmatch:
|
||||
@@ -144,7 +143,9 @@ def editflatpage(request, path):
|
||||
postbody = "</html>"
|
||||
body = flatpageForm.cleaned_data["html"]
|
||||
body = body.replace("\r", "")
|
||||
f.write("%s<head%s>%s</head>%s<body%s>\n%s</body>%s" % (preheader, headerargs, head, postheader, bodyargs, body, postbody))
|
||||
result = u"%s<head%s>%s</head>%s<body%s>\n%s</body>%s" % (preheader, headerargs, head, postheader, bodyargs, body, postbody)
|
||||
f = open(filepath, "w")
|
||||
f.write(result)
|
||||
f.close()
|
||||
return HttpResponseRedirect(reverse('flatpage', args=[path])) # Redirect after POST
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user