Apply ruff formatting
This commit is contained in:
parent
99c232fea2
commit
16ebf3bdb3
6 changed files with 5 additions and 18 deletions
|
|
@ -1,11 +1,10 @@
|
||||||
from unittest.mock import Mock, patch
|
from unittest.mock import patch
|
||||||
from urllib.parse import urlencode
|
from urllib.parse import urlencode
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
from django.core.cache import cache
|
from django.core.cache import cache
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
from django.utils.translation import gettext as _
|
|
||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,6 @@ REST_FRAMEWORK = {
|
||||||
"DEFAULT_RENDERER_CLASSES": (
|
"DEFAULT_RENDERER_CLASSES": (
|
||||||
"djangorestframework_camel_case.render.CamelCaseJSONRenderer",
|
"djangorestframework_camel_case.render.CamelCaseJSONRenderer",
|
||||||
),
|
),
|
||||||
|
|
||||||
"DEFAULT_PARSER_CLASSES": (
|
"DEFAULT_PARSER_CLASSES": (
|
||||||
"djangorestframework_camel_case.parser.CamelCaseJSONParser",
|
"djangorestframework_camel_case.parser.CamelCaseJSONParser",
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
from django import forms
|
from django import forms
|
||||||
from django.utils.translation import gettext_lazy as _
|
|
||||||
|
|
||||||
from newsreader.core.forms import CheckboxInput
|
from newsreader.core.forms import CheckboxInput
|
||||||
from newsreader.news.collection.forms.base import CollectionRuleForm
|
from newsreader.news.collection.forms.base import CollectionRuleForm
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from datetime import date, datetime, time, timezone
|
from datetime import datetime, timezone
|
||||||
|
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,7 @@ from newsreader.news.collection.views.base import CollectionRuleViewMixin
|
||||||
from newsreader.utils.views import NavListMixin
|
from newsreader.utils.views import NavListMixin
|
||||||
|
|
||||||
|
|
||||||
class CollectionRuleListView(
|
class CollectionRuleListView(CollectionRuleViewMixin, NavListMixin, ListView):
|
||||||
CollectionRuleViewMixin,
|
|
||||||
NavListMixin,
|
|
||||||
ListView
|
|
||||||
):
|
|
||||||
paginate_by = 50
|
paginate_by = 50
|
||||||
template_name = "news/collection/views/rules.html"
|
template_name = "news/collection/views/rules.html"
|
||||||
context_object_name = "rules"
|
context_object_name = "rules"
|
||||||
|
|
|
||||||
|
|
@ -25,12 +25,6 @@ class NavListMixin(ContextMixin):
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.request.user.is_authenticated:
|
if self.request.user.is_authenticated:
|
||||||
return {
|
return {**context_data, "sidebar_links": authenticated_links}
|
||||||
**context_data,
|
|
||||||
"sidebar_links": authenticated_links
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {**context_data, "sidebar_links": unauthenticated_links}
|
||||||
**context_data,
|
|
||||||
"sidebar_links": unauthenticated_links
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue