From 3bde493f85aa133918b8492f7bc14159fece0cee Mon Sep 17 00:00:00 2001 From: fmareuil <fmareuil@pasteur.fr> Date: Mon, 18 May 2020 17:06:33 +0200 Subject: [PATCH] new flake8 formatting cherry-picked from target-centric branch solved conflicts on ippisite/ippidb/urls.py (target-centric specific URLs) --- ippisite/ippidb/tasks.py | 8 ++++---- ippisite/ippidb/templatetags/customtags.py | 4 ++-- ippisite/ippidb/tests/tests_contribute_e2e.py | 2 +- ippisite/ippisite/settings.template.py | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ippisite/ippidb/tasks.py b/ippisite/ippidb/tasks.py index 0e090768..2fe4374d 100644 --- a/ippisite/ippidb/tasks.py +++ b/ippisite/ippidb/tasks.py @@ -535,9 +535,9 @@ def run_le_lle_plot(self: MonitorTask): :type self: MonitorTask """ self.update_state(state=states.STARTED) - self.write(std_out=f"Starting computing LE-LLE plot") + self.write(std_out="Starting computing LE-LLE plot") generate_le_lle_plot() - self.write(std_out=f"Finished computing LE-LLE plot") + self.write(std_out="Finished computing LE-LLE plot") @task(base=MonitorTask, bind=True) @@ -549,9 +549,9 @@ def run_pca_plot(self: MonitorTask): :type self: MonitorTask """ self.update_state(state=states.STARTED) - self.write(std_out=f"Starting computing PCA plot") + self.write(std_out="Starting computing PCA plot") generate_pca_plot() - self.write(std_out=f"Finished computing PCA plot") + self.write(std_out="Finished computing PCA plot") def launch_validate_contributions(contribution_ids: List[int]): diff --git a/ippisite/ippidb/templatetags/customtags.py b/ippisite/ippidb/templatetags/customtags.py index 1ea2c322..1b65ab01 100644 --- a/ippisite/ippidb/templatetags/customtags.py +++ b/ippisite/ippidb/templatetags/customtags.py @@ -141,8 +141,8 @@ def bootstrap_core(object): # print form's error which are not related to a field but the form itself form = object for field in form: - for l in bootstrap_core(field): - ret.append(l) + for el in bootstrap_core(field): + ret.append(el) elif isinstance(object, ErrorList): # print errors in a bootstrap way for error in object: diff --git a/ippisite/ippidb/tests/tests_contribute_e2e.py b/ippisite/ippidb/tests/tests_contribute_e2e.py index d5d2877f..fce7c8ca 100644 --- a/ippisite/ippidb/tests/tests_contribute_e2e.py +++ b/ippisite/ippidb/tests/tests_contribute_e2e.py @@ -230,7 +230,7 @@ class ContributionE2ETestCase(TestCase): self.assertEqual( response.url, reverse("contribution-detail", kwargs={"contribution_pk": 1}), - f"wrong final URL, should be the contribution permanent URL", + "wrong final URL, should be the contribution permanent URL", ) def _generate_wizard_data(self, entry_data): diff --git a/ippisite/ippisite/settings.template.py b/ippisite/ippisite/settings.template.py index f6f6f702..cc738033 100644 --- a/ippisite/ippisite/settings.template.py +++ b/ippisite/ippisite/settings.template.py @@ -10,14 +10,15 @@ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ +from django.utils.translation import gettext_lazy import os # set matplotlib backend import matplotlib + matplotlib.use("agg") # noqa: E402 BLK100 # Build paths inside the project like this: os.path.join(BASE_DIR, ...) -from django.utils.translation import gettext_lazy BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -- GitLab