aboutsummaryrefslogtreecommitdiff
path: root/qc_app
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-02-06 05:01:18 +0300
committerFrederick Muriuki Muriithi2024-02-06 05:01:18 +0300
commitf98d0325e641dd43e0ac460ef4fa931eb94c054f (patch)
treee04589a38c9c500685c13e3a119b52a10ab2be7b /qc_app
parent364dc6598e11151fd0b146814b2aaac272eec8d7 (diff)
downloadgn-uploader-f98d0325e641dd43e0ac460ef4fa931eb94c054f.tar.gz
Bug: Fix routing issues
Fix the routing issues that were redirecting the flow to the wrong endpoints.
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/templates/rqtl2/select-population.html3
-rw-r--r--qc_app/upload/rqtl2.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/qc_app/templates/rqtl2/select-population.html b/qc_app/templates/rqtl2/select-population.html
index a1e2a83..8f2db84 100644
--- a/qc_app/templates/rqtl2/select-population.html
+++ b/qc_app/templates/rqtl2/select-population.html
@@ -49,7 +49,8 @@
<p style="color:#FE3535; padding-left:20em; font-weight:bolder;">OR</p>
-<form method="POST" action="{{url_for('samples.create_population')}}">
+<form method="POST"
+ action="{{url_for('upload.rqtl2.create_population', species_id=species.SpeciesId)}}">
<legend class="heading">create new grouping/population</legend>
{{flash_messages("error-create-population")}}
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index 73d91ec..810e031 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -95,7 +95,8 @@ def select_population(species_id: int):
methods=["POST"])
def create_population(species_id: int):
"""Create a new population for the given species."""
- population_page = redirect(url_for("upload.rqtl2.select_population"))
+ population_page = redirect(url_for("upload.rqtl2.select_population",
+ species_id=species_id))
with database_connection(app.config["SQL_URI"]) as conn:
species = species_by_id(conn, species_id)
population_name = request.form.get("inbredset_name", "").strip()
@@ -121,6 +122,7 @@ def create_population(species_id: int):
flash("Population created successfully.", "alert-success")
return redirect(
url_for("upload.rqtl2.upload_rqtl2_bundle",
+ species_id=species_id,
population_id=new_population["population_id"],
pgsrc="create-population"),
code=307)