mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-21 10:29:29 -05:00
Resolve a bunch more view warnings
This commit is contained in:
parent
856352ba06
commit
6d29e2730d
@ -49,6 +49,8 @@ from django.views.decorators.http import condition
|
|||||||
from django.views.decorators.http import last_modified
|
from django.views.decorators.http import last_modified
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
from django_filters.rest_framework import DjangoFilterBackend
|
from django_filters.rest_framework import DjangoFilterBackend
|
||||||
|
from drf_spectacular.types import OpenApiTypes
|
||||||
|
from drf_spectacular.utils import OpenApiParameter
|
||||||
from drf_spectacular.utils import extend_schema
|
from drf_spectacular.utils import extend_schema
|
||||||
from drf_spectacular.utils import extend_schema_view
|
from drf_spectacular.utils import extend_schema_view
|
||||||
from langdetect import detect
|
from langdetect import detect
|
||||||
@ -1266,6 +1268,30 @@ class SelectionDataView(GenericAPIView):
|
|||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(
|
||||||
|
get=extend_schema(
|
||||||
|
description="Get a list of all available tags",
|
||||||
|
parameters=[
|
||||||
|
OpenApiParameter(
|
||||||
|
name="term",
|
||||||
|
required=False,
|
||||||
|
type=str,
|
||||||
|
description="Term to search for",
|
||||||
|
),
|
||||||
|
OpenApiParameter(
|
||||||
|
name="limit",
|
||||||
|
required=False,
|
||||||
|
type=int,
|
||||||
|
description="Number of completions to return",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
responses={
|
||||||
|
(200, "application/json"): serializers.ListSerializer(
|
||||||
|
child=serializers.CharField(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
class SearchAutoCompleteView(GenericAPIView):
|
class SearchAutoCompleteView(GenericAPIView):
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
|
||||||
@ -1493,6 +1519,14 @@ class GlobalSearchView(PassUserMixin):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(
|
||||||
|
get=extend_schema(
|
||||||
|
description="Get statistics for the current user",
|
||||||
|
responses={
|
||||||
|
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
class StatisticsView(GenericAPIView):
|
class StatisticsView(GenericAPIView):
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
|
||||||
@ -1786,6 +1820,14 @@ class UiSettingsView(GenericAPIView):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(
|
||||||
|
get=extend_schema(
|
||||||
|
description="Get the current version of the Paperless-NGX server",
|
||||||
|
responses={
|
||||||
|
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
class RemoteVersionView(GenericAPIView):
|
class RemoteVersionView(GenericAPIView):
|
||||||
def get(self, request, format=None):
|
def get(self, request, format=None):
|
||||||
remote_version = "0.0.0"
|
remote_version = "0.0.0"
|
||||||
@ -2089,6 +2131,14 @@ class CustomFieldViewSet(ModelViewSet):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(
|
||||||
|
get=extend_schema(
|
||||||
|
description="Get the current system status of the Paperless-NGX server",
|
||||||
|
responses={
|
||||||
|
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
class SystemStatusView(PassUserMixin):
|
class SystemStatusView(PassUserMixin):
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
|
||||||
|
@ -297,6 +297,16 @@ class TOTPView(GenericAPIView):
|
|||||||
return HttpResponseNotFound("TOTP not found")
|
return HttpResponseNotFound("TOTP not found")
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(
|
||||||
|
post=extend_schema(
|
||||||
|
request={
|
||||||
|
"application/json": None,
|
||||||
|
},
|
||||||
|
responses={
|
||||||
|
(200, "application/json"): OpenApiTypes.STR,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
class GenerateAuthTokenView(GenericAPIView):
|
class GenerateAuthTokenView(GenericAPIView):
|
||||||
"""
|
"""
|
||||||
Generates (or re-generates) an auth token, requires a logged in user
|
Generates (or re-generates) an auth token, requires a logged in user
|
||||||
@ -326,6 +336,23 @@ class ApplicationConfigurationViewSet(ModelViewSet):
|
|||||||
permission_classes = (IsAuthenticated, DjangoModelPermissions)
|
permission_classes = (IsAuthenticated, DjangoModelPermissions)
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(
|
||||||
|
post=extend_schema(
|
||||||
|
request={
|
||||||
|
"application/json": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {"type": "integer"},
|
||||||
|
},
|
||||||
|
"required": ["id"],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
responses={
|
||||||
|
(200, "application/json"): OpenApiTypes.INT,
|
||||||
|
400: OpenApiTypes.STR,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
class DisconnectSocialAccountView(GenericAPIView):
|
class DisconnectSocialAccountView(GenericAPIView):
|
||||||
"""
|
"""
|
||||||
Disconnects a social account provider from the user account
|
Disconnects a social account provider from the user account
|
||||||
@ -345,6 +372,13 @@ class DisconnectSocialAccountView(GenericAPIView):
|
|||||||
return HttpResponseBadRequest("Social account not found")
|
return HttpResponseBadRequest("Social account not found")
|
||||||
|
|
||||||
|
|
||||||
|
@extend_schema_view(
|
||||||
|
get=extend_schema(
|
||||||
|
responses={
|
||||||
|
(200, "application/json"): OpenApiTypes.OBJECT,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
class SocialAccountProvidersView(GenericAPIView):
|
class SocialAccountProvidersView(GenericAPIView):
|
||||||
"""
|
"""
|
||||||
List of social account providers
|
List of social account providers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user