mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-12-05 18:59:51 +00:00
Fix: remove some code hints as docstrings from api schema (#14974)
This commit is contained in:
1 parent
d1c3cefb62
commit
307ba6b9f6
1 file changed
+7
-10
+7
-10
@@ -436,9 +436,9 @@ class IndexView(TemplateView):
|
||||
|
||||
|
||||
class PassUserMixin(GenericAPIView[Any]):
|
||||
"""
|
||||
Pass a user object to serializer
|
||||
"""
|
||||
# Pass a user object to serializer.
|
||||
# (Comment, not docstring: drf-spectacular would use it as the description
|
||||
# of every inheriting view's operations.)
|
||||
|
||||
def get_serializer(self, *args, **kwargs):
|
||||
serializer_class = self.get_serializer_class()
|
||||
@@ -461,9 +461,8 @@ class PassUserMixin(GenericAPIView[Any]):
|
||||
|
||||
|
||||
class BulkPermissionMixin:
|
||||
"""
|
||||
Prefetch Django-Guardian permissions for a list before serialization, to avoid N+1 queries.
|
||||
"""
|
||||
# Prefetch Django-Guardian permissions for a list before serialization, to
|
||||
# avoid N+1 queries.
|
||||
|
||||
def get_serializer_context(self):
|
||||
"""
|
||||
@@ -502,7 +501,7 @@ class BulkPermissionMixin:
|
||||
|
||||
|
||||
class PermissionsAwareDocumentCountMixin(BulkPermissionMixin, PassUserMixin):
|
||||
"""Mixin to add document count to queryset, permissions-aware if needed"""
|
||||
# Mixin to add document count to queryset, permissions-aware if needed.
|
||||
|
||||
# Direct FK/M2M relation name from this model to Document, used for the
|
||||
# cheap Count(filter=...) path (Correspondent, DocumentType, StoragePath).
|
||||
@@ -647,9 +646,7 @@ class TagViewSet(PermissionsAwareDocumentCountMixin, ModelViewSet[Tag]):
|
||||
return context
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
"""
|
||||
Build a children map once to avoid per-parent queries in the serializer.
|
||||
"""
|
||||
# Build a children map once to avoid per-parent queries in the serializer.
|
||||
queryset = self.filter_queryset(self.get_queryset())
|
||||
ordering = OrderingFilter().get_ordering(request, queryset, self) or (
|
||||
Lower("name"),
|
||||
|
||||
Reference in new issue
Block a user