mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-31 13:58:04 -06:00
Initial task for building
This commit is contained in:
@@ -2190,6 +2190,7 @@ class ShareBundleSerializer(OwnedObjectSerializer):
|
||||
"status",
|
||||
"size_bytes",
|
||||
"last_error",
|
||||
"built_at",
|
||||
"documents",
|
||||
"document_ids",
|
||||
"document_count",
|
||||
@@ -2202,6 +2203,7 @@ class ShareBundleSerializer(OwnedObjectSerializer):
|
||||
"status",
|
||||
"size_bytes",
|
||||
"last_error",
|
||||
"built_at",
|
||||
"documents",
|
||||
"document_count",
|
||||
)
|
||||
@@ -2253,10 +2255,14 @@ class ShareBundleSerializer(OwnedObjectSerializer):
|
||||
|
||||
ordered_documents = [documents_by_id[doc_id] for doc_id in document_ids]
|
||||
share_bundle.documents.set(ordered_documents)
|
||||
share_bundle.document_total = len(ordered_documents)
|
||||
|
||||
return share_bundle
|
||||
|
||||
def get_document_count(self, obj: ShareBundle) -> int:
|
||||
count = getattr(obj, "document_total", None)
|
||||
if count is not None:
|
||||
return count
|
||||
return obj.documents.count()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user