aboutsummaryrefslogtreecommitdiff
path: root/uploader/species
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-03 11:31:01 -0500
committerFrederick Muriuki Muriithi2024-09-03 13:51:31 -0500
commit7d26a65c825acbe9922b332ef5543e92222e7076 (patch)
tree5c24e82f6cf7728a559fa696be6120a6ff74f136 /uploader/species
parent64790126035e2ee1a10693aad9bd4045fd575727 (diff)
downloadgn-uploader-7d26a65c825acbe9922b332ef5543e92222e7076.tar.gz
Provide UI for viewing species details.
Diffstat (limited to 'uploader/species')
-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