diff options
author | Frederick Muriuki Muriithi | 2024-02-05 07:00:01 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-02-05 07:00:01 +0300 |
commit | ab71b34b97f3f1eee52b5688f41644541535f281 (patch) | |
tree | 4ae94d1957a62bd739203eddc4c157d2701461e4 /qc_app/upload | |
parent | 635cf832f4717da6e8e7ef273a675a4ceea42ed0 (diff) | |
download | gn-uploader-ab71b34b97f3f1eee52b5688f41644541535f281.tar.gz |
Do general bundle validation and show errors
* Display any and all errors on the UI
* Move `validate_bundle` to QC module and refactor to use
`missing_files`
Diffstat (limited to 'qc_app/upload')
-rw-r--r-- | qc_app/upload/rqtl2.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py index eea49e1..2d032f8 100644 --- a/qc_app/upload/rqtl2.py +++ b/qc_app/upload/rqtl2.py @@ -18,6 +18,8 @@ from flask import ( current_app as app) from r_qtl import r_qtl2 +from r_qtl import errors as rqe +from r_qtl import r_qtl2_qc as rqc from r_qtl.errors import InvalidFormat from qc_app import jobs @@ -157,11 +159,11 @@ def upload_rqtl2_bundle(species_id: int, population_id: int): species=species, population=population) - if not bool(request.files.get("rqtl2_bundle")): + if not bool(request.files.get("rqtl2_bundle_file")): raise __RequestError__("No R/qtl2 zip bundle provided.") - the_file = save_file( - request.files["rqtl2_bundle"], Path(app.config["UPLOAD_FOLDER"])) + the_file = save_file(request.files["rqtl2_bundle_file"], + Path(app.config["UPLOAD_FOLDER"])) if not bool(the_file): raise __RequestError__("Please provide a valid R/qtl2 zip bundle.") @@ -170,7 +172,7 @@ def upload_rqtl2_bundle(species_id: int, population_id: int): try: with ZipFile(str(the_file), "r") as zfile: - r_qtl2.validate_bundle(zfile) + rqc.validate_bundle(zfile) return render_template( "rqtl2/upload-rqtl2-bundle-step-02.html", species=species, |