aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-02-18 08:38:52 -0600
committerFrederick Muriuki Muriithi2025-02-18 08:38:52 -0600
commit45d5b3d3af37f5ec59326d94e1dfa7383f547286 (patch)
tree49acabf7f43ebeefa66b9ba6df337d932070395c
parent9ee7f2eee907d0d073097ae3c0112b8b24419730 (diff)
downloadgn-uploader-45d5b3d3af37f5ec59326d94e1dfa7383f547286.tar.gz
Redirect to "Create Species" page if user selects it.
Add the "Create Species" sub-step to the phenotype data path.
-rw-r--r--uploader/phenotypes/views.py8
1 files changed, 7 insertions, 1 deletions
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"))