mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-22 07:53:19 +01:00
Ensure multipart attachments are saved
This commit is contained in:
parent
ae2f24b299
commit
cdbd531931
@ -687,8 +687,8 @@ def extract_part_data(
|
||||
name = f"part-{counter}{ext}"
|
||||
else:
|
||||
name = f"part-{counter}_{name}"
|
||||
|
||||
files.append(SimpleUploadedFile(name, part.get_payload(decode=True), mimetypes.guess_type(name)[0]))
|
||||
payload = decodeUnknown(part.get_charset(), part.as_bytes()) if part.is_multipart() else part.get_payload(decode=True)
|
||||
files.append(SimpleUploadedFile(name, payload, mimetypes.guess_type(name)[0]))
|
||||
logger.debug("Found MIME attachment %s", name)
|
||||
return part_body, part_full_body
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user