diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-12-30 14:15:08 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-12-30 14:15:08 +0000 |
commit | 26454bf6c6764d2df5a45b48773bfa2c88a13fcc (patch) | |
tree | 9b2a0abbb40a91eccd244e58cba86d2f3cf6e86e /core/views/expo.py | |
parent | 1da2be03e66deb1d03f2dac0da2e95384cb9261e (diff) | |
download | troggle-26454bf6c6764d2df5a45b48773bfa2c88a13fcc.tar.gz troggle-26454bf6c6764d2df5a45b48773bfa2c88a13fcc.tar.bz2 troggle-26454bf6c6764d2df5a45b48773bfa2c88a13fcc.zip |
first attempt EtP fix for cave pages
Diffstat (limited to 'core/views/expo.py')
-rw-r--r-- | core/views/expo.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/views/expo.py b/core/views/expo.py index 0bff259..83dafa1 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -121,6 +121,8 @@ def expowebpage(request, expowebpath, path): '''Adds menus and serves an HTML page ''' if not Path(expowebpath / path).is_file(): + # Should not get here if the path has suffix "_edit" + print(f' - 404 error in expowebpage() {path}') return render(request, 'pagenotfound.html', {'path': path}, status="404") with open(os.path.normpath(expowebpath / path), "r") as o: @@ -264,7 +266,7 @@ def editexpopage(request, path): filepath = Path(settings.EXPOWEB) / path o = open(filepath, "r") html = o.read() - autogeneratedmatch = re.search(r"\<\!--\s*(.*?(Do not edit|auto-generated).*?)\s*--\>", html, re.DOTALL + re.IGNORECASE) + autogeneratedmatch = re.search(r"\<\!--\s*(.*?(Do not edit|It is auto-generated).*?)\s*--\>", html, re.DOTALL + re.IGNORECASE) if autogeneratedmatch: return HttpResponse(autogeneratedmatch.group(1)) m = re.search(r"(.*)<head([^>]*)>(.*)</head>(.*)<body([^>]*)>(.*)</body>(.*)", html, re.DOTALL + re.IGNORECASE) |