Fix formatting errors warnings

This commit is contained in:
Sonny Bakker 2025-05-05 15:42:12 +02:00
parent eadd7a5612
commit cf96371b90
5 changed files with 5 additions and 14 deletions

View file

@ -1,7 +1,3 @@
import os
from pathlib import Path
from dotenv import load_dotenv from dotenv import load_dotenv
from newsreader.conf.utils import get_env, get_root_dir from newsreader.conf.utils import get_env, get_root_dir
@ -186,9 +182,7 @@ USE_TZ = True
STATIC_URL = "/static/" STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "static" STATIC_ROOT = BASE_DIR / "static"
STATICFILES_DIRS = ( STATICFILES_DIRS = (DJANGO_PROJECT_DIR / "static",)
DJANGO_PROJECT_DIR / "static",
)
STATICFILES_FINDERS = [ STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.FileSystemFinder",

View file

@ -11,7 +11,7 @@ EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"
INSTALLED_APPS += ["debug_toolbar", "django_extensions"] # noqa: F405 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", "django.template.context_processors.debug",
) )

View file

@ -17,7 +17,7 @@ LOGGING["loggers"].update( # noqa: F405
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" 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", "django.template.context_processors.debug",
) )

View file

@ -1,5 +1,3 @@
import os
from newsreader.conf.utils import get_env from newsreader.conf.utils import get_env
from .base import * # noqa: F403 from .base import * # noqa: F403
@ -11,8 +9,7 @@ DEBUG = False
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
ADMINS = [ ADMINS = [
("", email) ("", email) for email in get_env("ADMINS", split=",", required=False, default=[])
for email in get_env("ADMINS", split=",", required=False, default=[])
] ]
# Project settings # Project settings

View file

@ -14,7 +14,7 @@ def get_env(
cast: Type = str, cast: Type = str,
required: bool = True, required: bool = True,
default: Any = None, default: Any = None,
split: str = "" split: str = "",
) -> Any: ) -> Any:
if cast is not str and split: if cast is not str and split:
raise TypeError(f"Split is not possible with {cast}") raise TypeError(f"Split is not possible with {cast}")