Browse Source

added a more descriptive "not found" page

master
Fr3deric 6 years ago
parent
commit
8faf1aeca7
  1. 2
      journalmarks/journalmarks.py
  2. 15
      journalmarks/templates/not_found.html

2
journalmarks/journalmarks.py

@ -228,7 +228,7 @@ def get_journalmark(tag): @@ -228,7 +228,7 @@ def get_journalmark(tag):
(Journalmark.tag == tag) & (Journalmark.user == flask_g.user)
).get()
except DoesNotExist:
return ('tag not found', 404, None)
return render_template('not_found.html')
return render_template('get_journalmark.html', j=j)

15
journalmarks/templates/not_found.html

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
{% extends "base.html" %}
{% block script %}
<style>
p {
text-align: center;
}
</style>
{% endblock %}
{% block body %}
<h1>Journalmark not found</h1>
<p>There is no Journalmark with the provided tag code.</p>
<p><a href="{{ url_for('journalmarks.index') }}">Back to welcome page</a></p>
{% endblock %}
Loading…
Cancel
Save