mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-03 01:56:16 +00:00
Dont fetch doc content on suggestions
This commit is contained in:
@@ -758,7 +758,14 @@ class DocumentViewSet(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
def suggestions(self, request, pk=None):
|
def suggestions(self, request, pk=None):
|
||||||
doc = get_object_or_404(Document.objects.select_related("owner"), pk=pk)
|
# Don't fetch content here
|
||||||
|
doc = get_object_or_404(
|
||||||
|
Document.objects.select_related("owner").only(
|
||||||
|
"id",
|
||||||
|
"owner_id",
|
||||||
|
),
|
||||||
|
pk=pk,
|
||||||
|
)
|
||||||
if request.user is not None and not has_perms_owner_aware(
|
if request.user is not None and not has_perms_owner_aware(
|
||||||
request.user,
|
request.user,
|
||||||
"view_document",
|
"view_document",
|
||||||
|
Reference in New Issue
Block a user