edit this page working

This commit is contained in:
Philip Sargent
2020-06-18 15:54:40 +01:00
parent 640e1e3b5e
commit bd6490631f
2 changed files with 18 additions and 27 deletions

View File

@@ -89,10 +89,10 @@ def flatpage(request, path):
menumatch = re.match(rb'(.*)<ul id="links">', body, re.DOTALL + re.IGNORECASE)
if menumatch:
has_menu = True
#body, = menumatch.groups()
if re.search(rb"iso-8859-1", html):
body = str(body, "iso-8859-1")
body.strip
body, = menumatch.groups()
# if re.search(rb"iso-8859-1", html):
# body = str(body, "iso-8859-1")
# body.strip
return render(request, 'flatpage.html', {'editable': editable, 'path': path, 'title': title, 'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu})
else:
return HttpResponse(o.read(), content_type=getmimetype(path))
@@ -137,8 +137,8 @@ def editflatpage(request, path):
linksmatch = re.match(r'(.*)(<ul\s+id="links">.*)', body, re.DOTALL + re.IGNORECASE)
if linksmatch:
body, links = linksmatch.groups()
if re.search(r"iso-8859-1", html):
body = str(body, "iso-8859-1")
# if re.search(r"iso-8859-1", html):
# body = str(body, "iso-8859-1")
else:
return HttpResponse("Page could not be split into header and body")
except IOError: