mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-04 23:30:33 +00:00
Enhancement: centralized management of share links + bundles (#14115)
This commit is contained in:
+10
-3
@@ -1983,7 +1983,14 @@ class DocumentViewSet(
|
||||
now = timezone.now()
|
||||
links = (
|
||||
ShareLink.objects.filter(document=doc)
|
||||
.only("pk", "created", "expiration", "slug")
|
||||
.select_related("document")
|
||||
.only(
|
||||
"pk",
|
||||
"created",
|
||||
"expiration",
|
||||
"slug",
|
||||
"document__title",
|
||||
)
|
||||
.exclude(expiration__lt=now)
|
||||
.order_by("-created")
|
||||
)
|
||||
@@ -4665,7 +4672,7 @@ class ShareLinkViewSet(
|
||||
):
|
||||
model = ShareLink
|
||||
|
||||
queryset = ShareLink.objects.all()
|
||||
queryset = ShareLink.objects.select_related("document")
|
||||
|
||||
serializer_class = ShareLinkSerializer
|
||||
pagination_class = StandardPagination
|
||||
@@ -4676,7 +4683,7 @@ class ShareLinkViewSet(
|
||||
PermittedObjectsFilter,
|
||||
)
|
||||
filterset_class = ShareLinkFilterSet
|
||||
ordering_fields = ("created", "expiration", "document")
|
||||
ordering_fields = ("created", "expiration", "document__title")
|
||||
|
||||
|
||||
@extend_schema_view(
|
||||
|
||||
Reference in New Issue
Block a user