about summary refs log tree commit diff
path: root/uploader/phenotypes
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-02-18 11:10:29 -0600
committerFrederick Muriuki Muriithi2025-02-18 11:10:29 -0600
commit3c960f6cf885934e5f390390c9e0fae0d6b93d5d (patch)
treef62bcadb0be4b6239f2de9bf1b927461a7c4ddb7 /uploader/phenotypes
parent14714a035e267a17c7111aec7b047104a1c34d36 (diff)
downloadgn-uploader-3c960f6cf885934e5f390390c9e0fae0d6b93d5d.tar.gz
Enable creating new populations on the "Phenotype Data" path.
Enable creating new populations in the case where the population a
user wants to use does not exist in the database.
Diffstat (limited to 'uploader/phenotypes')
-rw-r--r--uploader/phenotypes/views.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py
index c0ab493..bcbb3a9 100644
--- a/uploader/phenotypes/views.py
+++ b/uploader/phenotypes/views.py
@@ -89,14 +89,18 @@ def select_population(species: dict, **kwargs):# pylint: disable=[unused-argumen
         if not bool(request.args.get("population_id")):
             return render_template("phenotypes/select-population.html",
                                    species=species,
-                                   populations=order_by_family(
-                                       populations_by_species(
-                                           conn, species["SpeciesId"]),
-                                       order_key="FamilyOrder"),
+                                   populations=populations_by_species(
+                                       conn, species["SpeciesId"]),
                                    activelink="phenotypes")
 
+        population_id = request.args["population_id"]
+        if population_id == "CREATE-POPULATION":
+            return redirect(url_for(
+                "species.populations.create_population",
+                species_id=species["SpeciesId"],
+                return_to="species.populations.phenotypes.list_datasets"))
         population = population_by_species_and_id(
-            conn, species["SpeciesId"], int(request.args["population_id"]))
+            conn, species["SpeciesId"], int(population_id))
         if not bool(population):
             flash("No such population found!", "alert-danger")
             return redirect(url_for(