summaryrefslogtreecommitdiffstats
path: root/flatpages
diff options
context:
space:
mode:
Diffstat (limited to 'flatpages')
-rw-r--r--flatpages/views.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/flatpages/views.py b/flatpages/views.py
index 6fb68bb..3a1bc40 100644
--- a/flatpages/views.py
+++ b/flatpages/views.py
@@ -107,6 +107,9 @@ def editflatpage(request, path):
filepath = os.path.normpath(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)
+ if autogeneratedmatch:
+ return HttpResponse(autogeneratedmatch.group(1))
m = re.search(r"(.*)<head([^>]*)>(.*)</head>(.*)<body([^>]*)>(.*)</body>(.*)", html, re.DOTALL + re.IGNORECASE)
if m:
filefound = True