aboutsummaryrefslogtreecommitdiff
path: root/uploader/species/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/species/views.py')
-rw-r--r--uploader/species/views.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/uploader/species/views.py b/uploader/species/views.py
index f2d7545..6009f03 100644
--- a/uploader/species/views.py
+++ b/uploader/species/views.py
@@ -38,7 +38,14 @@ def list_species():
def view_species(species_id: int):
"""View details of a particular species and menus to act upon it."""
with database_connection(app.config["SQL_URI"]) as conn:
- return species_by_id(conn, species_id)
+ species = species_by_id(conn, species_id)
+ if bool(species):
+ return render_template("species/view-species.html",
+ species=species,
+ activelink="view-species")
+ flash("Could not find a species with the given identifier.",
+ "alert-danger")
+ return redirect(url_for("species.view_species"))
@speciesbp.route("/create", methods=["GET", "POST"])
@require_login