about summary refs log tree commit diff
path: root/qc_app/upload
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-01-05 13:13:39 +0300
committerFrederick Muriuki Muriithi2024-01-05 13:13:39 +0300
commit15289ced90dbecaaa710318ccfcf8b002e3121c6 (patch)
treecbfe15c1c7da861f377d4ccbfb71422e7cd00404 /qc_app/upload
parent58a214a4a9be5fb219a798b62cdbf43d72280c74 (diff)
downloadgn-uploader-15289ced90dbecaaa710318ccfcf8b002e3121c6.tar.gz
UI to select the population under which the data falls.
Diffstat (limited to 'qc_app/upload')
-rw-r--r--qc_app/upload/rqtl2.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index e54f141..06edfee 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -29,3 +29,20 @@ def select_species():
             "upload.rqtl2.select_population", species_id=species_id))
     flash("Invalid species or no species selected!", "alert-error error-rqtl2")
     return redirect(url_for("upload.rqtl2.select_species"))
+
+@rqtl2.route("/upload/species/<int:species_id>/select-population",
+             methods=["GET", "POST"])
+def select_population(species_id: int):
+    """Select/Create the population to organise data under."""
+    species = with_db_connection(lambda conn: species_by_id(conn, species_id))
+    if not bool(species):
+        flash("Invalid species selected!", "alert-error error-rqtl2")
+        return redirect(url_for("upload.rqtl2.select_species"))
+
+    if request.method == "GET":
+        return render_template(
+            "rqtl2/select-population.html",
+            species=species,
+            populations=groups_by_species(species_id))
+
+    return "WOULD PROCESS DATA"