aboutsummaryrefslogtreecommitdiff
path: root/qc_app/upload/rqtl2.py
diff options
context:
space:
mode:
Diffstat (limited to 'qc_app/upload/rqtl2.py')
-rw-r--r--qc_app/upload/rqtl2.py22
1 files changed, 14 insertions, 8 deletions
diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py
index 6a8ab72..41663ff 100644
--- a/qc_app/upload/rqtl2.py
+++ b/qc_app/upload/rqtl2.py
@@ -267,14 +267,20 @@ def check_errors(conn, *args, **kwargs):#pylint: disable=[too-many-return-statem
url_for("upload.rqtl2.select_population", pgsrc="error"),
code=307)
- if ("rqtl2_bundle_file" in args
- and not bool(request.form.get("rqtl2_bundle_file"))):
- flash("There is no file to process.", "alert-error error-rqtl2")
- return redirect(url_for("upload.rqtl2.upload_rqtl2_bundle",
- species_id=species_id,
- population_id=population_id,
- pgsrc="error"),
- code=307)
+ if "rqtl2_bundle_file" in args:
+ fileuploadpage = redirect(url_for("upload.rqtl2.upload_rqtl2_bundle",
+ species_id=species_id,
+ population_id=population_id,
+ pgsrc="error"),
+ code=307)
+ if not bool(request.form.get("rqtl2_bundle_file")):
+ flash("There is no file to process.", "alert-error error-rqtl2")
+ return fileuploadpage
+
+ if not Path(fullpath(request.form["rqtl2_bundle_file"])).exists():
+ flash("No R/qtl2 bundle with the given name exists.",
+ "alert-error error-rqtl2")
+ return fileuploadpage
if ("geno-dataset" in args and
not bool(request.form.get("geno-dataset-id"))):