aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--uploader/samples/views.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/uploader/samples/views.py b/uploader/samples/views.py
index 6e3dc4b..18a3bdd 100644
--- a/uploader/samples/views.py
+++ b/uploader/samples/views.py
@@ -39,6 +39,7 @@ from .models import samples_by_species_and_population
samplesbp = Blueprint("samples", __name__)
@samplesbp.route("/samples", methods=["GET"])
+@require_login
def index():
"""Direct entry-point for uploading/handling the samples."""
with database_connection(app.config["SQL_URI"]) as conn:
@@ -56,6 +57,7 @@ def index():
@samplesbp.route("<int:species_id>/samples/select-population", methods=["GET"])
+@require_login
def select_population(species_id: int):
"""Select the population to use for the samples."""
with database_connection(app.config["SQL_URI"]) as conn:
@@ -86,6 +88,7 @@ def select_population(species_id: int):
population_id=population["Id"]))
@samplesbp.route("<int:species_id>/populations/<int:population_id>/samples")
+@require_login
def list_samples(species_id: int, population_id: int):
"""
List the samples in a particular population and give the ability to upload
@@ -224,6 +227,7 @@ def upload_samples(species_id: int, population_id: int):#pylint: disable=[too-ma
@samplesbp.route("<int:species_id>/populations/<int:population_id>/"
"upload-samples/status/<uuid:job_id>",
methods=["GET"])
+@require_login
def upload_status(species_id: int, population_id: int, job_id: uuid.UUID):
"""Check on the status of a samples upload job."""
with database_connection(app.config["SQL_URI"]) as conn:
@@ -273,6 +277,7 @@ def upload_status(species_id: int, population_id: int, job_id: uuid.UUID):
population=population), 400
@samplesbp.route("/upload/failure/<uuid:job_id>", methods=["GET"])
+@require_login
def upload_failure(job_id: uuid.UUID):
"""Display the errors of the samples upload failure."""
job = with_redis_connection(lambda rconn: jobs.job(