From 307ba6b9f6b9ccc82d33264889f466cd9b4217a2 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 3 Dec 2026 14:17:23 -0800 Subject: [PATCH] Fix: remove some code hints as docstrings from api schema (#14974) --- src/documents/views.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/documents/views.py b/src/documents/views.py index c26769b24..a786f7fcd 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -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"),