aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-07-11 05:05:51 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-07-11 05:05:51 +0400
commit36a461b57c5b901fb5cfb81966bac3f0387fd590 (patch)
tree1b83c893a9ed1aec003ee406b92409dd5497a0e6 /pydis_site/apps
parentRemove Message Model Test (diff)
Bump flake8-bandit To v3
Bumps flake-bandit to v3 to fix an incompatibility with the bandit package. This also bumps flake8-annotations to a legally acceptable version, which introduces ANN401, which disallows `typing.Any` annotations (for the most part, refer to the docs). Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to 'pydis_site/apps')
-rw-r--r--pydis_site/apps/api/pagination.py5
-rw-r--r--pydis_site/apps/content/views/page_category.py4
2 files changed, 4 insertions, 5 deletions
diff --git a/pydis_site/apps/api/pagination.py b/pydis_site/apps/api/pagination.py
index 2a325460..61707d33 100644
--- a/pydis_site/apps/api/pagination.py
+++ b/pydis_site/apps/api/pagination.py
@@ -1,7 +1,6 @@
-import typing
-
from rest_framework.pagination import LimitOffsetPagination
from rest_framework.response import Response
+from rest_framework.utils.serializer_helpers import ReturnList
class LimitOffsetPaginationExtended(LimitOffsetPagination):
@@ -44,6 +43,6 @@ class LimitOffsetPaginationExtended(LimitOffsetPagination):
default_limit = 100
- def get_paginated_response(self, data: typing.Any) -> Response:
+ def get_paginated_response(self, data: ReturnList) -> Response:
"""Override to skip metadata i.e. `count`, `next`, and `previous`."""
return Response(data)
diff --git a/pydis_site/apps/content/views/page_category.py b/pydis_site/apps/content/views/page_category.py
index 5af77aff..356eb021 100644
--- a/pydis_site/apps/content/views/page_category.py
+++ b/pydis_site/apps/content/views/page_category.py
@@ -3,7 +3,7 @@ from pathlib import Path
import frontmatter
from django.conf import settings
-from django.http import Http404
+from django.http import Http404, HttpRequest, HttpResponse
from django.views.generic import TemplateView
from pydis_site.apps.content import utils
@@ -12,7 +12,7 @@ from pydis_site.apps.content import utils
class PageOrCategoryView(TemplateView):
"""Handles pages and page categories."""
- def dispatch(self, request: t.Any, *args, **kwargs) -> t.Any:
+ def dispatch(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
"""Conform URL path location to the filesystem path."""
self.location = Path(kwargs.get("location", ""))