aboutsummaryrefslogtreecommitdiff
path: root/qc_app/entry.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-12-06 13:00:53 +0300
committerFrederick Muriuki Muriithi2023-12-06 13:00:53 +0300
commit493f8fbe747650a4fbac2e0b153ad0074b4f91e4 (patch)
tree578fce7f9548c4a850a02b5817865e5fcb73d007 /qc_app/entry.py
parent968fc27c54099ec1ed5d1770925aed98013ecf55 (diff)
downloadgn-uploader-493f8fbe747650a4fbac2e0b153ad0074b4f91e4.tar.gz
Feature: Upload Samples/Cases
Implements the code enabling the upload of the samples/cases to the database.
Diffstat (limited to 'qc_app/entry.py')
-rw-r--r--qc_app/entry.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/qc_app/entry.py b/qc_app/entry.py
index abea5ed..bf78037 100644
--- a/qc_app/entry.py
+++ b/qc_app/entry.py
@@ -14,6 +14,8 @@ from flask import (
render_template,
current_app as app)
+from .dbinsert import species
+
entrybp = Blueprint("entry", __name__)
def errors(rqst) -> Tuple[str, ...]:
@@ -76,14 +78,14 @@ def zip_file_errors(filepath, upload_dir) -> Tuple[str, ...]:
def upload_file():
"""Enables uploading the files"""
if request.method == "GET":
- return render_template("index.html")
+ return render_template("index.html", species = species())
upload_dir = app.config["UPLOAD_FOLDER"]
request_errors = errors(request)
if request_errors:
for error in request_errors:
flash(error, "alert-error")
- return render_template("index.html"), 400
+ return render_template("index.html", species = species()), 400
filename = secure_filename(request.files["qc_text_file"].filename)
if not os.path.exists(upload_dir):
@@ -96,7 +98,7 @@ def upload_file():
if zip_errors:
for error in zip_errors:
flash(error, "alert-error")
- return render_template("index.html"), 400
+ return render_template("index.html", species = species()), 400
return redirect(url_for(
"parse.parse", filename=filename,