diff --git a/app/urls.py b/app/urls.py index 957d375..661ea6d 100644 --- a/app/urls.py +++ b/app/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.contrib import admin from django.urls import include, path, re_path from django.views.generic.base import RedirectView diff --git a/bot_seo/pyadaptivecards_tools.py b/bot_seo/pyadaptivecards_tools.py index 1a23129..2b125a6 100644 --- a/bot_seo/pyadaptivecards_tools.py +++ b/bot_seo/pyadaptivecards_tools.py @@ -1,4 +1,5 @@ """ Extensions and hacks for pyadaptivecards. """ + from typing import Literal, List, Optional from pyadaptivecards.abstract_components import Serializable diff --git a/okr/admin/__init__.py b/okr/admin/__init__.py index 350ebc3..5bfa2ac 100644 --- a/okr/admin/__init__.py +++ b/okr/admin/__init__.py @@ -1,4 +1,5 @@ """Module for Django backend.""" + # flake8: noqa from django.contrib import admin diff --git a/okr/models/__init__.py b/okr/models/__init__.py index 235fba9..635dff5 100644 --- a/okr/models/__init__.py +++ b/okr/models/__init__.py @@ -1,4 +1,5 @@ """Module for Django model definitions.""" + # flake8: noqa from .base import * diff --git a/okr/patch_django_extensions.py b/okr/patch_django_extensions.py index 90a3e8b..e43f2d1 100644 --- a/okr/patch_django_extensions.py +++ b/okr/patch_django_extensions.py @@ -23,9 +23,9 @@ def get_appmodel_context(self, appmodel, appmodel_abstracts): ] context["m2m_targets"] = m2m_targets - context[ - "docstring" - ] = "Automatisch erzeugte Tabelle für eine Many-to-Many-Relation." + context["docstring"] = ( + "Automatisch erzeugte Tabelle für eine Many-to-Many-Relation." + ) return context diff --git a/okr/scrapers/common/google.py b/okr/scrapers/common/google.py index 41998e4..c52c1ff 100644 --- a/okr/scrapers/common/google.py +++ b/okr/scrapers/common/google.py @@ -1,6 +1,7 @@ """Set up Google service account credentials and required services. Requires the ``GOOGLE_SERVICE_ACCOUNT`` environment variable to be set. """ + import json import os import re diff --git a/okr/scrapers/podcasts/__init__.py b/okr/scrapers/podcasts/__init__.py index b59173f..d730fb3 100644 --- a/okr/scrapers/podcasts/__init__.py +++ b/okr/scrapers/podcasts/__init__.py @@ -536,13 +536,13 @@ def _scrape_spotify_api_episode_data(podcast, start_date, end_date): episode_data[agg_type] = {"total": 0} try: - episode_data[ - "listeners_all_time" - ] = spotify_api.podcast_episode_data_all_time( - podcast.spotify_id, - podcast_episode.spotify_id, - "listeners", - end=date, + episode_data["listeners_all_time"] = ( + spotify_api.podcast_episode_data_all_time( + podcast.spotify_id, + podcast_episode.spotify_id, + "listeners", + end=date, + ) ) except SpotifyException: episode_data["listeners_all_time"] = {"total": 0} diff --git a/okr/scrapers/youtube/__init__.py b/okr/scrapers/youtube/__init__.py index 8d52881..630f749 100644 --- a/okr/scrapers/youtube/__init__.py +++ b/okr/scrapers/youtube/__init__.py @@ -121,9 +121,11 @@ def _scrape_youtube_traffic_source( for source_type, (views, minutes_watched) in json_data.items(): defaults = { "views": views, - "watch_time": to_timedelta(minutes_watched * 60) - if minutes_watched is not None - else None, + "watch_time": ( + to_timedelta(minutes_watched * 60) + if minutes_watched is not None + else None + ), "quintly_last_updated": BERLIN.localize( dt.datetime.fromisoformat(row.importTime) ), diff --git a/worker.py b/worker.py index 456c74e..d73c317 100644 --- a/worker.py +++ b/worker.py @@ -1,6 +1,5 @@ """ Main entrypoint for the worker process """ - import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")