diff options
Diffstat (limited to 'qc_app/samples.py')
-rw-r--r-- | qc_app/samples.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/qc_app/samples.py b/qc_app/samples.py index 55e94ab..1845818 100644 --- a/qc_app/samples.py +++ b/qc_app/samples.py @@ -219,9 +219,12 @@ def upload_samples(): flash("Invalid grouping/population!", "alert-error") return samples_uploads_page - samples_file = save_file(request.files["samples_file"], Path(app.config["UPLOAD_FOLDER"])) - if not bool(samples_file): - flash("You need to provide a file with the samples data.") + try: + samples_file = save_file(request.files["samples_file"], + Path(app.config["UPLOAD_FOLDER"])) + except AssertionError: + flash("You need to provide a file with the samples data.", + "alert-error") return samples_uploads_page firstlineheading = (request.form.get("first_line_heading") == "on") |