aboutsummaryrefslogtreecommitdiff
path: root/qc_app
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-06-15 08:05:11 +0300
committerFrederick Muriuki Muriithi2022-06-15 08:05:11 +0300
commit6760d322637a3d875242a66e9c1a784866d7df1d (patch)
tree9c789b3f25cb1b1c04dc7974f9aab0ffcb6acdf4 /qc_app
parentc2fa70ec8503d10b990575a547036bfd70a53825 (diff)
downloadgn-uploader-6760d322637a3d875242a66e9c1a784866d7df1d.tar.gz
Setup test fixtures and initial tests for web-UI
Diffstat (limited to 'qc_app')
-rw-r--r--qc_app/entry.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/qc_app/entry.py b/qc_app/entry.py
index d876bb7..7f67a33 100644
--- a/qc_app/entry.py
+++ b/qc_app/entry.py
@@ -24,7 +24,7 @@ def errors(request) -> Tuple[str, ...]:
def __filetype_error__():
return (
("Invalid file type provided.",)
- if request.form["filetype"] not in ("average", "standard-error")
+ if request.form.get("filetype") not in ("average", "standard-error")
else tuple())
def __file_missing_error__():
@@ -76,10 +76,10 @@ def zip_file_errors(filepath, upload_dir) -> Tuple[str, ...]:
@entrybp.route("/", methods=["GET", "POST"])
def upload_file():
"""Enables uploading the files"""
- upload_dir = app.config["UPLOAD_FOLDER"]
if request.method == "GET":
return render_template("index.html")
+ upload_dir = app.config["UPLOAD_FOLDER"]
request_errors = errors(request)
if request_errors:
for error in request_errors: