Skip to content

Commit 36ff66f

Browse files
committed
Linting fixes
1 parent 8048c3f commit 36ff66f

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

cms/dashboard/viewsets.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
from django.urls import path
55
from django.urls.resolvers import RoutePattern
6-
from django.db.models import Q
76
from drf_spectacular.utils import extend_schema
87
from rest_framework.request import Request
98
from rest_framework.response import Response
@@ -90,14 +89,15 @@ def get_queryset(self):
9089
page_ptr__in=queryset,
9190
).values_list("page_ptr_id", flat=True)
9291

93-
public_metrics_doc_child_page_ids = MetricsDocumentationChildEntry.objects.filter(
94-
is_public=True,
95-
page_ptr__in=queryset,
96-
).values_list("page_ptr_id", flat=True)
92+
public_metrics_doc_child_page_ids = (
93+
MetricsDocumentationChildEntry.objects.filter(
94+
is_public=True,
95+
page_ptr__in=queryset,
96+
).values_list("page_ptr_id", flat=True)
97+
)
9798

9899
always_public_page_ids = queryset.not_type(
99-
TopicPage,
100-
MetricsDocumentationChildEntry
100+
TopicPage, MetricsDocumentationChildEntry
101101
).values_list("id", flat=True)
102102

103103
allowed_page_ids = [

tests/integration/cms/dashboard/test_viewsets.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def setup_pages(self):
321321
@staticmethod
322322
def _get_response_titles(response) -> set[str]:
323323
return {item["title"] for item in response.data["items"]}
324-
324+
325325
@mock.patch("cms.dashboard.viewsets.AUTH_ENABLED", True)
326326
def test_anonymous_search_returns_public_pages(self, setup_pages):
327327
"""
@@ -377,7 +377,9 @@ def test_auth_disabled_returns_unfiltered_pages(self, setup_pages):
377377
assert "Regression Search Private Metric 2" in titles
378378

379379
@mock.patch("cms.dashboard.viewsets.AUTH_ENABLED", True)
380-
def test_restricted_user_search_returns_public_and_permitted_pages(self, setup_pages):
380+
def test_restricted_user_search_returns_public_and_permitted_pages(
381+
self, setup_pages
382+
):
381383
"""
382384
Given an athenticated restricted user has access to some private pages
383385
When the list `GET /api/pages/?search=<term>` endpoint is hit
@@ -387,8 +389,7 @@ def test_restricted_user_search_returns_public_and_permitted_pages(self, setup_p
387389
mock_user = mock.MagicMock()
388390
mock_user.username = "restricted-user"
389391
mock_user.permission_sets = MockPermissionSets(
390-
[{"theme": {"id": "1"}, "sub_theme": {"id": "-1"}}],
391-
has_global_access=False
392+
[{"theme": {"id": "1"}, "sub_theme": {"id": "-1"}}], has_global_access=False
392393
)
393394

394395
api_client = APIClient()
@@ -411,4 +412,4 @@ def test_restricted_user_search_returns_public_and_permitted_pages(self, setup_p
411412

412413
assert "Regression Search Private Topic" in titles
413414
assert "Regression Search Private Metric" not in titles
414-
assert "Regression Search Private Metric 2" in titles
415+
assert "Regression Search Private Metric 2" in titles

0 commit comments

Comments
 (0)