diff options
Diffstat (limited to 'uploader/samples')
-rw-r--r-- | uploader/samples/views.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/uploader/samples/views.py b/uploader/samples/views.py index f444497..fd3c601 100644 --- a/uploader/samples/views.py +++ b/uploader/samples/views.py @@ -19,9 +19,9 @@ from flask import ( from uploader import jobs from uploader.files import save_file -from uploader.datautils import order_by_family from uploader.authorisation import require_login from uploader.input_validation import is_integer_input +from uploader.datautils import order_by_family, enumerate_sequence from uploader.db_utils import ( with_db_connection, database_connection, @@ -107,8 +107,8 @@ def list_samples(species_id: int, population_id: int): "species.populations.samples.select_population", species_id=species_id)) - all_samples = samples_by_species_and_population( - conn, species_id, population_id) + all_samples = enumerate_sequence(samples_by_species_and_population( + conn, species_id, population_id)) total_samples = len(all_samples) offset = int(request.args.get("from") or 0) if offset < 0: @@ -200,6 +200,11 @@ def upload_samples(species_id: int, population_id: int):#pylint: disable=[too-ma redisuri = app.config["REDIS_URL"] with Redis.from_url(redisuri, decode_responses=True) as rconn: + #TODO: Add a QC step here — what do we check? + # 1. Does any sample in the uploaded file exist within the database? + # If yes, what is/are its/their species and population? + # 2. If yes 1. above, provide error with notes on which species and + # populations already own the samples. the_job = jobs.launch_job( jobs.initialise_job( rconn, |