aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-03 10:18:36 -0500
committerFrederick Muriuki Muriithi2024-09-03 10:18:36 -0500
commit9b3e7b0203f582d4193def2d24a9c77683bc8456 (patch)
treee5c5a75fcad206cfdb8d37105976d9fc7766f171
parente49b4367f1dab1c3acb3cd5d71ba09359c5ab4ee (diff)
downloadgn-uploader-9b3e7b0203f582d4193def2d24a9c77683bc8456.tar.gz
Put active pages behind auth. Flash all error messages.
-rw-r--r--uploader/species/views.py3
-rw-r--r--uploader/templates/index.html1
2 files changed, 4 insertions, 0 deletions
diff --git a/uploader/species/views.py b/uploader/species/views.py
index af66de3..3a76494 100644
--- a/uploader/species/views.py
+++ b/uploader/species/views.py
@@ -7,6 +7,7 @@ from flask import (flash,
current_app as app,
render_template as flask_render_template)
+from uploader.authorisation import require_login
from uploader.db_utils import database_connection
from .models import all_species, save_species, species_by_id
@@ -28,12 +29,14 @@ def list_species():
allspecies=all_species(conn))
@speciesbp.route("/<int:species_id>", methods=["GET"])
+@require_login
def view_species(species_id: int):
"""View details of a particular species and menus to act upon it."""
with database_connection(app.config["SQL_URI"]) as conn:
return species_by_id(conn, species_id)
@speciesbp.route("/create", methods=["GET", "POST"])
+@require_login
def create_species():
"""Create a new species."""
# We can use uniprot's API to fetch the details with something like
diff --git a/uploader/templates/index.html b/uploader/templates/index.html
index 75d7dec..e3f5af4 100644
--- a/uploader/templates/index.html
+++ b/uploader/templates/index.html
@@ -14,6 +14,7 @@
{%block contents%}
<div class="row">
+ {{flash_all_messages()}}
<div class="explainer">
<p>Welcome to the <strong>GeneNetwork Data Quality Control and Upload System</strong>. This system is provided to help in uploading your data onto GeneNetwork where you can do analysis on it.</p>