From cf96371b90f5333d7a6f3743ff5acc113615d86d Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Mon, 5 May 2025 15:42:12 +0200 Subject: [PATCH] Fix formatting errors warnings --- src/newsreader/conf/base.py | 8 +------- src/newsreader/conf/dev.py | 2 +- src/newsreader/conf/docker.py | 2 +- src/newsreader/conf/production.py | 5 +---- src/newsreader/conf/utils.py | 2 +- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/newsreader/conf/base.py b/src/newsreader/conf/base.py index b13d732..220e8d1 100644 --- a/src/newsreader/conf/base.py +++ b/src/newsreader/conf/base.py @@ -1,7 +1,3 @@ -import os - -from pathlib import Path - from dotenv import load_dotenv from newsreader.conf.utils import get_env, get_root_dir @@ -186,9 +182,7 @@ USE_TZ = True STATIC_URL = "/static/" STATIC_ROOT = BASE_DIR / "static" -STATICFILES_DIRS = ( - DJANGO_PROJECT_DIR / "static", -) +STATICFILES_DIRS = (DJANGO_PROJECT_DIR / "static",) STATICFILES_FINDERS = [ "django.contrib.staticfiles.finders.FileSystemFinder", diff --git a/src/newsreader/conf/dev.py b/src/newsreader/conf/dev.py index 2bd7625..57aaff3 100644 --- a/src/newsreader/conf/dev.py +++ b/src/newsreader/conf/dev.py @@ -11,7 +11,7 @@ EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" INSTALLED_APPS += ["debug_toolbar", "django_extensions"] # noqa: F405 -TEMPLATES[0]["OPTIONS"]["context_processors"].append( +TEMPLATES[0]["OPTIONS"]["context_processors"].append( # noqa: F405 "django.template.context_processors.debug", ) diff --git a/src/newsreader/conf/docker.py b/src/newsreader/conf/docker.py index 0bddf32..3485bf3 100644 --- a/src/newsreader/conf/docker.py +++ b/src/newsreader/conf/docker.py @@ -17,7 +17,7 @@ LOGGING["loggers"].update( # noqa: F405 EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" -TEMPLATES[0]["OPTIONS"]["context_processors"].append( +TEMPLATES[0]["OPTIONS"]["context_processors"].append( # noqa: F405 "django.template.context_processors.debug", ) diff --git a/src/newsreader/conf/production.py b/src/newsreader/conf/production.py index bfe665d..e4053ec 100644 --- a/src/newsreader/conf/production.py +++ b/src/newsreader/conf/production.py @@ -1,5 +1,3 @@ -import os - from newsreader.conf.utils import get_env from .base import * # noqa: F403 @@ -11,8 +9,7 @@ DEBUG = False SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") ADMINS = [ - ("", email) - for email in get_env("ADMINS", split=",", required=False, default=[]) + ("", email) for email in get_env("ADMINS", split=",", required=False, default=[]) ] # Project settings diff --git a/src/newsreader/conf/utils.py b/src/newsreader/conf/utils.py index 2e084f6..c46b59d 100644 --- a/src/newsreader/conf/utils.py +++ b/src/newsreader/conf/utils.py @@ -14,7 +14,7 @@ def get_env( cast: Type = str, required: bool = True, default: Any = None, - split: str = "" + split: str = "", ) -> Any: if cast is not str and split: raise TypeError(f"Split is not possible with {cast}")