From 16ebf3bdb3d93a9ecfa87d61ba18d388a59ba7bb Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 6 Oct 2024 20:47:57 +0200 Subject: [PATCH] Apply ruff formatting --- src/newsreader/accounts/tests/test_integrations.py | 3 +-- src/newsreader/conf/base.py | 1 - src/newsreader/news/collection/forms/feed.py | 1 - .../news/collection/tests/endpoints/rule/list/tests.py | 2 +- src/newsreader/news/collection/views/rules.py | 6 +----- src/newsreader/utils/views.py | 10 ++-------- 6 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/newsreader/accounts/tests/test_integrations.py b/src/newsreader/accounts/tests/test_integrations.py index e6e5d98..de0b142 100644 --- a/src/newsreader/accounts/tests/test_integrations.py +++ b/src/newsreader/accounts/tests/test_integrations.py @@ -1,11 +1,10 @@ -from unittest.mock import Mock, patch +from unittest.mock import patch from urllib.parse import urlencode from uuid import uuid4 from django.core.cache import cache from django.test import TestCase from django.urls import reverse -from django.utils.translation import gettext as _ from bs4 import BeautifulSoup diff --git a/src/newsreader/conf/base.py b/src/newsreader/conf/base.py index 815e2b2..bc22f2b 100644 --- a/src/newsreader/conf/base.py +++ b/src/newsreader/conf/base.py @@ -239,7 +239,6 @@ REST_FRAMEWORK = { "DEFAULT_RENDERER_CLASSES": ( "djangorestframework_camel_case.render.CamelCaseJSONRenderer", ), - "DEFAULT_PARSER_CLASSES": ( "djangorestframework_camel_case.parser.CamelCaseJSONParser", ), diff --git a/src/newsreader/news/collection/forms/feed.py b/src/newsreader/news/collection/forms/feed.py index 1f1d767..0b52c5f 100644 --- a/src/newsreader/news/collection/forms/feed.py +++ b/src/newsreader/news/collection/forms/feed.py @@ -1,5 +1,4 @@ from django import forms -from django.utils.translation import gettext_lazy as _ from newsreader.core.forms import CheckboxInput from newsreader.news.collection.forms.base import CollectionRuleForm diff --git a/src/newsreader/news/collection/tests/endpoints/rule/list/tests.py b/src/newsreader/news/collection/tests/endpoints/rule/list/tests.py index 6590900..51334b5 100644 --- a/src/newsreader/news/collection/tests/endpoints/rule/list/tests.py +++ b/src/newsreader/news/collection/tests/endpoints/rule/list/tests.py @@ -1,6 +1,6 @@ import json -from datetime import date, datetime, time, timezone +from datetime import datetime, timezone from django.test import TestCase from django.urls import reverse diff --git a/src/newsreader/news/collection/views/rules.py b/src/newsreader/news/collection/views/rules.py index 5d142c4..753d9d7 100644 --- a/src/newsreader/news/collection/views/rules.py +++ b/src/newsreader/news/collection/views/rules.py @@ -10,11 +10,7 @@ from newsreader.news.collection.views.base import CollectionRuleViewMixin from newsreader.utils.views import NavListMixin -class CollectionRuleListView( - CollectionRuleViewMixin, - NavListMixin, - ListView -): +class CollectionRuleListView(CollectionRuleViewMixin, NavListMixin, ListView): paginate_by = 50 template_name = "news/collection/views/rules.html" context_object_name = "rules" diff --git a/src/newsreader/utils/views.py b/src/newsreader/utils/views.py index 0a14477..3ba752a 100644 --- a/src/newsreader/utils/views.py +++ b/src/newsreader/utils/views.py @@ -25,12 +25,6 @@ class NavListMixin(ContextMixin): } if self.request.user.is_authenticated: - return { - **context_data, - "sidebar_links": authenticated_links - } + return {**context_data, "sidebar_links": authenticated_links} - return { - **context_data, - "sidebar_links": unauthenticated_links - } + return {**context_data, "sidebar_links": unauthenticated_links}