Fix: prevent doc permissions queries on schema view (#14503)

This commit is contained in:
shamoon authored and GitHub committed 2026-10-19 22:25:52 -07:00
1 parent 8bbca8a269
commit d4826f50c9
1 file changed
+5
+5
View File
@@ -498,6 +498,11 @@ class BulkPermissionMixin:
"""
context = super().get_serializer_context()
if getattr(self, "swagger_fake_view", False):
# Schema generation only needs the serializer shape; without a
# paginated page we'd otherwise scan the entire queryset below.
return context
if getattr(self, "action", None) != "list":
# Batching only pays off across a page of objects; for single-object
# actions (retrieve, update, ...) the per-object fallback in