diff options
Diffstat (limited to 'qc_app/upload')
-rw-r--r-- | qc_app/upload/rqtl2.py | 17 |
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" |