mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-09-02 16:07:15 +00:00
Fix: re-use permitted_object_ids
This commit is contained in:
@@ -635,7 +635,9 @@ class TagViewSet(PermissionsAwareDocumentCountMixin, ModelViewSet[Tag]):
|
||||
annotate_document_count_for_related_queryset(
|
||||
Tag.objects.filter(
|
||||
pk__in=descendant_pks | {t.pk for t in all_tags},
|
||||
).select_related("owner"),
|
||||
)
|
||||
.filter(pk__in=permitted_object_ids(user, Tag, "view_tag"))
|
||||
.select_related("owner"),
|
||||
through_model=self.document_count_through,
|
||||
related_object_field=self._get_document_count_source_field(),
|
||||
user=user,
|
||||
|
||||
Reference in New Issue
Block a user