From a5477c59452cdb01ab536f11eb5ed6fab015f3af Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 25 Apr 2022 16:22:33 +0300 Subject: Call parsing function. Fix a few issues. * qc_app/entry.py: Pass filetype onward to parsing endpoint * qc_app/parse.py: Call the function(s) necessary to parse a file * quality_control/errors.py: Fix argument passing to super class --- qc_app/entry.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'qc_app/entry.py') diff --git a/qc_app/entry.py b/qc_app/entry.py index e7ed294..31d64ca 100644 --- a/qc_app/entry.py +++ b/qc_app/entry.py @@ -11,8 +11,6 @@ from flask import ( render_template, current_app as app) -from quality_control.parsing import FileType - entrybp = Blueprint("entry", __name__) @entrybp.route("/", methods=["GET", "POST"]) @@ -40,12 +38,11 @@ def upload_file(): if errors: return render_template("index.html") - filetype = ( - FileType.AVERAGE if request.form["filetype"] == "average" - else FileType.STANDARD_ERROR) filename = secure_filename(text_file.filename) if not os.path.exists(app.config["UPLOAD_FOLDER"]): os.mkdir(app.config["UPLOAD_FOLDER"]) text_file.save(os.path.join(app.config["UPLOAD_FOLDER"], filename)) - return redirect(url_for("parse.parse_file", filename=filename)) + return redirect(url_for( + "parse.parse", filename=filename, + filetype=request.form["filetype"])) -- cgit v1.2.3