diff options
Diffstat (limited to 'uploader/samples')
| -rw-r--r-- | uploader/samples/models.py | 3 | ||||
| -rw-r--r-- | uploader/samples/views.py | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/uploader/samples/models.py b/uploader/samples/models.py index b419d61..1e9293f 100644 --- a/uploader/samples/models.py +++ b/uploader/samples/models.py @@ -34,8 +34,7 @@ def read_samples_file(filepath, separator: str, firstlineheading: bool, **kwargs else ("Name", "Name2", "Symbol", "Alias")), delimiter=separator, quotechar=kwargs.get("quotechar", '"')) - for row in reader: - yield row + yield from reader def save_samples_data(conn: mdb.Connection, diff --git a/uploader/samples/views.py b/uploader/samples/views.py index c0adb88..f8baf7e 100644 --- a/uploader/samples/views.py +++ b/uploader/samples/views.py @@ -7,13 +7,13 @@ from pathlib import Path from redis import Redis from flask import (flash, request, - url_for, redirect, Blueprint, current_app as app) from uploader import jobs from uploader.files import save_file +from uploader.flask_extensions import url_for from uploader.ui import make_template_renderer from uploader.authorisation import require_login from uploader.input_validation import is_integer_input @@ -96,7 +96,7 @@ def list_samples(species: dict, population: dict, **kwargs):# pylint: disable=[u activelink="list-samples") -def build_sample_upload_job(# pylint: disable=[too-many-arguments] +def build_sample_upload_job(# pylint: disable=[too-many-arguments, too-many-positional-arguments] speciesid: int, populationid: int, samplesfile: Path, @@ -159,7 +159,7 @@ def upload_samples(species_id: int, population_id: int):#pylint: disable=[too-ma "alert-error") return samples_uploads_page - firstlineheading = (request.form.get("first_line_heading") == "on") + firstlineheading = request.form.get("first_line_heading") == "on" separator = request.form.get("separator", ",") if separator == "other": @@ -172,7 +172,7 @@ 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? + #T0DO: 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 @@ -251,7 +251,7 @@ def upload_status(species: dict, population: dict, job_id: uuid.UUID, **kwargs): @require_login @with_population(species_redirect_uri="species.populations.samples.index", redirect_uri="species.populations.samples.select_population") -def upload_failure(species: dict, population: dict, job_id: uuid.UUID, **kwargs): +def upload_failure(species: dict, population: dict, job_id: uuid.UUID, **kwargs):# pylint: disable=[unused-argument] """Display the errors of the samples upload failure.""" job = with_redis_connection(lambda rconn: jobs.job( rconn, jobs.jobsnamespace(), job_id)) |
