From d809997e8ca76d2441b58693078c6c9698e769bb Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 16 Jan 2024 12:38:30 +0300 Subject: 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. --- qc_app/upload/rqtl2.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'qc_app/upload') 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 -- cgit v1.2.3