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

This commit is contained in:
shamoon
2026-09-01 09:55:04 -07:00
committed by GitHub
parent 741115b36b
commit b8659c1af3
2 changed files with 39 additions and 1 deletions
+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}"