Fix: use root doc metadata for filename generation (#13893)

This commit is contained in:
shamoon authored and GitHub committed 2026-09-01 09:55:04 -07:00
1 parent 741115b36b
commit b8659c1af3
2 files changed
+39 -1

No files matched your search

+5 -1
View File
@@ -462,7 +462,11 @@ class Document(SoftDeleteModel, ModelWithOwner): # type: ignore[django-manager-
"""
Returns a sanitized filename for the document, not including any paths.
"""
result = str(self)
# Root owns metadata for all versions
context_document = (
self.root_document if self.root_document_id is not None else self
)
result = str(context_document)
if counter:
result += f"_{counter:02}"