aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-01-16 12:38:30 +0300
committerFrederick Muriuki Muriithi2024-01-16 12:38:30 +0300
commitd809997e8ca76d2441b58693078c6c9698e769bb (patch)
treeddbc9ecd2cbc3c0243e46b2e1e95491afec31a86
parent7d6deb76edde8dce5414220586c1fde0ddebfc6e (diff)
downloadgn-uploader-d809997e8ca76d2441b58693078c6c9698e769bb.tar.gz
Create intermediate step
We do not have the option to modify the request and then redirect with the modification in place. To go around that, this commit creates an intermediate step that informs the user of their progress, while allowing us to store the filename for future steps.
-rw-r--r--qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html (renamed from qc_app/templates/rqtl2/upload-rqtl2-bundle.html)0
-rw-r--r--qc_app/upload/rqtl2.py8
2 files changed, 6 insertions, 2 deletions
diff --git a/qc_app/templates/rqtl2/upload-rqtl2-bundle.html b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
index 6491e6b..6491e6b 100644
--- a/qc_app/templates/rqtl2/upload-rqtl2-bundle.html
+++ b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-01.html
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index d60ea65..0eca6ae 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -132,7 +132,7 @@ def upload_rqtl2_bundle(species_id: int, population_id: int):
if request.method == "GET" or (
request.method == "POST"
and bool(request.args.get("pgsrc"))):
- return render_template("rqtl2/upload-rqtl2-bundle.html",
+ return render_template("rqtl2/upload-rqtl2-bundle-step-01.html",
species=species,
population=population)
@@ -150,7 +150,11 @@ def upload_rqtl2_bundle(species_id: int, population_id: int):
try:
with ZipFile(str(the_file), "r") as zfile:
r_qtl2.validate_bundle(zfile)
- return "WOULD PROCESS THE BUNDLE..."
+ return render_template(
+ "rqtl2/upload-rqtl2-bundle-step-02.html",
+ species=species,
+ population=population,
+ rqtl2_bundle_file=the_file.name)
except (InvalidFormat, __RequestError__) as exc:
flash("".join(exc.args), "alert-error alert-danger error-rqtl2")
return this_page_with_errors