projects
/
pgweb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
998403d
)
Add a 403 template that shows the exception string
author
Magnus Hagander
<magnus@hagander.net>
Thu, 13 Jul 2023 12:05:35 +0000
(14:05 +0200)
committer
Magnus 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]
patch
|
blob
diff --git a/templates/403.html
b/templates/403.html
new file mode 100644
(file)
index 0000000..
a13cd61
--- /dev/null
+++ b/
templates/403.html
@@ -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%}