aboutsummaryrefslogtreecommitdiff
path: root/qc_app
diff options
context:
space:
mode:
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/entry.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/qc_app/entry.py b/qc_app/entry.py
index c53648a..efcaf4e 100644
--- a/qc_app/entry.py
+++ b/qc_app/entry.py
@@ -55,7 +55,7 @@ def zip_file_errors(filepath, upload_dir) -> Tuple[str, ...]:
if len(infolist) != 1:
zfile_errors = zfile_errors + (
("Expected exactly one (1) member file within the uploaded zip "
- "file. Got {len(infolist)} member files."),)
+ f"file. Got {len(infolist)} member files."),)
if len(infolist) == 1 and infolist[0].is_dir():
zfile_errors = zfile_errors + (
("Expected a member text file in the uploaded zip file. Got a "
@@ -82,7 +82,7 @@ def upload_file():
if request_errors:
for error in request_errors:
flash(error, "alert-error")
- return render_template("index.html")
+ return render_template("index.html"), 400
filename = secure_filename(request.files["qc_text_file"].filename)
if not os.path.exists(upload_dir):
@@ -95,7 +95,7 @@ def upload_file():
if zip_errors:
for error in zip_errors:
flash(error, "alert-error")
- return render_template("index.html")
+ return render_template("index.html"), 400
return redirect(url_for(
"parse.parse", filename=filename,