Add a 403 template that shows the exception string
authorMagnus Hagander <magnus@hagander.net>
Thu, 13 Jul 2023 12:05:35 +0000 (14:05 +0200)
committerMagnus Hagander <magnus@hagander.net>
Thu, 13 Jul 2023 12:06:24 +0000 (14:06 +0200)
We have numerous places where we raise PermissionDenied() errors, but
the default template in use wouldn't show the error message to the user
outside of debug mode. Oops.

templates/403.html [new file with mode: 0644]

diff --git a/templates/403.html b/templates/403.html
new file mode 100644 (file)
index 0000000..a13cd61
--- /dev/null
@@ -0,0 +1,9 @@
+{%extends "base/page.html"%}
+{%block title%}Forbidden{%endblock%}
+{%block contents%}
+<h1>Forbidden</h1>
+
+<p>
+{%if exception%}{{exception}}{%else%}Forbidden{%endif%}
+</p>
+{%endblock%}