From 09324400848011782e87c5b937e03f03e5046250 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 20 Jun 2024 14:39:38 +0100 Subject: [PATCH] fix linting --- ceuk-marking/urls.py | 1 + crowdsourcer/management/commands/import_national_data.py | 2 +- .../management/commands/send_council_signup_email.py | 6 +++--- .../management/commands/send_password_reset_emails.py | 6 +++--- crowdsourcer/middleware.py | 6 +++--- crowdsourcer/views/base.py | 6 +++--- crowdsourcer/views/marking.py | 6 +++--- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/ceuk-marking/urls.py b/ceuk-marking/urls.py index c86995c7..39693d79 100644 --- a/ceuk-marking/urls.py +++ b/ceuk-marking/urls.py @@ -13,6 +13,7 @@ 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ + from django.conf import settings from django.conf.urls.static import static from django.contrib import admin diff --git a/crowdsourcer/management/commands/import_national_data.py b/crowdsourcer/management/commands/import_national_data.py index b3d4eeac..5a3b2743 100644 --- a/crowdsourcer/management/commands/import_national_data.py +++ b/crowdsourcer/management/commands/import_national_data.py @@ -84,7 +84,7 @@ class Command(BaseCommand): {"desc": "50% recycling rate", "score": 1}, {"desc": "60% recycling rate", "score": 2}, {"desc": "70% recycling rate", "score": 3}, - ] + ], # "options": [{"desc": "Criteria not met", "score": 0},] }, { diff --git a/crowdsourcer/management/commands/send_council_signup_email.py b/crowdsourcer/management/commands/send_council_signup_email.py index ea13fc45..658442a6 100644 --- a/crowdsourcer/management/commands/send_council_signup_email.py +++ b/crowdsourcer/management/commands/send_council_signup_email.py @@ -40,9 +40,9 @@ def handle(self, *args, **kwargs): form = PasswordResetForm({"email": user.email}) assert form.is_valid() request = HttpRequest() - request.META[ - "SERVER_NAME" - ] = "marking.councilclimatescorecards.uk" + request.META["SERVER_NAME"] = ( + "marking.councilclimatescorecards.uk" + ) request.META["SERVER_PORT"] = 443 form.save( request=request, diff --git a/crowdsourcer/management/commands/send_password_reset_emails.py b/crowdsourcer/management/commands/send_password_reset_emails.py index 6f2c4467..e5ff566e 100644 --- a/crowdsourcer/management/commands/send_password_reset_emails.py +++ b/crowdsourcer/management/commands/send_password_reset_emails.py @@ -36,9 +36,9 @@ def handle(self, *args, **kwargs): form = PasswordResetForm({"email": user.email}) assert form.is_valid() request = HttpRequest() - request.META[ - "SERVER_NAME" - ] = "marking.councilclimatescorecards.uk" + request.META["SERVER_NAME"] = ( + "marking.councilclimatescorecards.uk" + ) request.META["SERVER_PORT"] = 443 form.save( request=request, diff --git a/crowdsourcer/middleware.py b/crowdsourcer/middleware.py index 127c162d..174eae67 100644 --- a/crowdsourcer/middleware.py +++ b/crowdsourcer/middleware.py @@ -39,9 +39,9 @@ def process_template_response(self, request, response): context["marking_session"] = request.current_session context["sessions"] = MarkingSession.objects.filter(active=True) context["brand"] = settings.BRAND - context[ - "brand_include" - ] = f"crowdsourcer/cobrand/navbar_{context['brand']}.html" + context["brand_include"] = ( + f"crowdsourcer/cobrand/navbar_{context['brand']}.html" + ) response.context_data = context diff --git a/crowdsourcer/views/base.py b/crowdsourcer/views/base.py index 1f9aa74a..1248ea1e 100644 --- a/crowdsourcer/views/base.py +++ b/crowdsourcer/views/base.py @@ -158,9 +158,9 @@ def get_context_data(self, **kwargs): name=self.kwargs.get("name", "") ) context["authority_name"] = self.kwargs.get("name", "") - context[ - "page_title" - ] = f"{self.title_start}{context['authority_name']}: {context['section_title']}" + context["page_title"] = ( + f"{self.title_start}{context['authority_name']}: {context['section_title']}" + ) context["has_previous_questions"] = self.has_previous_questions context["council_minutes"] = self.authority.get_data("council_minutes") diff --git a/crowdsourcer/views/marking.py b/crowdsourcer/views/marking.py index 9168c084..173dc4d6 100644 --- a/crowdsourcer/views/marking.py +++ b/crowdsourcer/views/marking.py @@ -122,9 +122,9 @@ def get_context_data(self, **kwargs): if self.request.current_session is None or self.request.current_stage is None: if user.is_superuser: - context[ - "setup_required" - ] = "You need to add a marking session with a request type in the admin." + context["setup_required"] = ( + "You need to add a marking session with a request type in the admin." + ) else: context["setup_required"] = "This site is not set up yet."