From 74452fe58f1e79effa47c06dcee49b04397c717f Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Thu, 7 Jul 2016 02:50:45 -0400 Subject: [PATCH] Add ability for 404 page to show error description. --- realms/modules/wiki/views.py | 2 +- realms/templates/errors/404.html | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/realms/modules/wiki/views.py b/realms/modules/wiki/views.py index d850ff5..632b643 100644 --- a/realms/modules/wiki/views.py +++ b/realms/modules/wiki/views.py @@ -75,7 +75,7 @@ def history(name): more = True items.pop() if page > 1 and not items: - abort(404) + abort(404, 'Page is past end of history.') for item in items: item['gravatar'] = gravatar_url(item['author_email']) return render_template('wiki/history.html', name=name, history=items, diff --git a/realms/templates/errors/404.html b/realms/templates/errors/404.html index 66bfd47..11e4044 100644 --- a/realms/templates/errors/404.html +++ b/realms/templates/errors/404.html @@ -2,5 +2,8 @@ {% block body %}

Page Not Found

+ {% if error is defined %} +

{{ error.description }}

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