diff options
author | Frederick Muriuki Muriithi | 2024-06-13 12:02:36 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-06-13 12:09:40 -0500 |
commit | 0a8fdbf4084c064c6839e6283781ede09983e742 (patch) | |
tree | 00d3d04b410f6454f42d9a4e2cac9c0770f10be2 /qc_app/entry.py | |
parent | f726c71bf1636a838f45363d1613763a2926e34f (diff) | |
download | gn-uploader-0a8fdbf4084c064c6839e6283781ede09983e742.tar.gz |
Clean up landing page
Leave only data upload type selection on landing page.
Diffstat (limited to 'qc_app/entry.py')
-rw-r--r-- | qc_app/entry.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/qc_app/entry.py b/qc_app/entry.py index 94bbd53..d23a45a 100644 --- a/qc_app/entry.py +++ b/qc_app/entry.py @@ -84,20 +84,24 @@ def zip_file_errors(filepath, upload_dir) -> Tuple[str, ...]: return zfile_errors -@entrybp.route("/", methods=["GET", "POST"]) +@entrybp.route("/", methods=["GET"]) +def index(): + """Load the landing page""" + return render_template("index.html") + +@entrybp.route("/upload", methods=["GET", "POST"]) def upload_file(): """Enables uploading the files""" if request.method == "GET": return render_template( - "index.html", species=with_db_connection(species)) + "select_species.html", species=with_db_connection(species)) upload_dir = app.config["UPLOAD_FOLDER"] request_errors = errors(request) if request_errors: for error in request_errors: flash(error, "alert-error error-expr-data") - return render_template( - "index.html", species=with_db_connection(species)), 400 + return redirect(url_for("entry.upload_file")) filename = secure_filename(request.files["qc_text_file"].filename) if not os.path.exists(upload_dir): |