Enhancement: use friendly file names when emailing documents (#11055)

This commit is contained in:
Jan Kleine
2025-10-15 19:10:25 +02:00
committed by GitHub
parent 39c429bb87
commit 340754d865
5 changed files with 142 additions and 29 deletions

View File

@@ -1207,21 +1207,13 @@ class DocumentViewSet(
):
return HttpResponseForbidden("Insufficient permissions")
attachments = []
for doc in documents:
attachment_path = (
doc.archive_path
if use_archive_version and doc.has_archive_version
else doc.source_path
)
attachments.append((attachment_path, doc.mime_type))
try:
send_email(
subject=subject,
body=message,
to=addresses,
attachments=attachments,
attachments=documents,
use_archive=use_archive_version,
)
logger.debug(