diff --git a/core/views/expo.py b/core/views/expo.py index 3e36862..900ca32 100644 --- a/core/views/expo.py +++ b/core/views/expo.py @@ -379,10 +379,11 @@ def editexpopage(request, path): o = open(filepath, "r", encoding="utf8") html = o.read() autogeneratedmatch = re.search( - r"\<\!--\s*(.*?(Do not edit|It is auto-generated).*?)\s*--\>", html, re.DOTALL + re.IGNORECASE + r"\<\!--\s*(.*?(Do not edit|It is auto-generated|NOEDIT).*?)\s*--\>", html, re.DOTALL + re.IGNORECASE ) if autogeneratedmatch: - return HttpResponse(autogeneratedmatch.group(1)) + message = "\tThis page is either auto-generated, and so cannot be edited,\n\t\tor it is too complex to allow users to edit it safely. \n\n\t\tA safer means of updating this page is on the programmers' to-do list." + return render(request, "errors/notice.html", {"message": message}) m = re.search(r"(.*)]*)>(.*)(.*)]*)>(.*)(.*)", html, re.DOTALL + re.IGNORECASE) if m: filefound = True diff --git a/templates/errors/notice.html b/templates/errors/notice.html new file mode 100644 index 0000000..75666c8 --- /dev/null +++ b/templates/errors/notice.html @@ -0,0 +1,50 @@ +{% extends 'base.html' %} + +{% block title %}Troggle Notice - Generic{% endblock %} +{% block content %} + +
+

Troggle Notice

+
+ + + + + +{% endblock %} \ No newline at end of file