From 45d5b3d3af37f5ec59326d94e1dfa7383f547286 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 18 Feb 2025 08:38:52 -0600 Subject: Redirect to "Create Species" page if user selects it. Add the "Create Species" sub-step to the phenotype data path. --- uploader/phenotypes/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'uploader') diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index e0ce521..c0ab493 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -65,7 +65,13 @@ def index(): species=all_species(conn), activelink="phenotypes") - species = species_by_id(conn, request.args.get("species_id")) + species_id = request.args.get("species_id") + if species_id == "CREATE-SPECIES": + return redirect(url_for( + "species.create_species", + return_to="species.populations.phenotypes.select_population")) + + species = species_by_id(conn, species_id) if not bool(species): flash("No such species!", "alert-danger") return redirect(url_for("species.populations.phenotypes.index")) -- cgit v1.2.3