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"(.*)]*)>(.*)(.*)]*)>(.*)(.*)", html, re.DOTALL + re.IGNORECASE) if m: filefound = True