Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions naomi/mail/backends/naomi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def write_message(self, message):
if hasattr(message, 'attachments') and message.attachments:
temporary_path = settings.EMAIL_FILE_PATH
for attachment in message.attachments:
new_file = open(os.path.join(temporary_path, attachment.name), 'wb+')
new_file.write(attachment.read())
attachments.append([attachment.name, new_file.name])
new_file = open(os.path.join(temporary_path, attachment.filename), 'wb+')
new_file.write(attachment.content)
attachments.append([attachment.filename, new_file.name])
new_file.close()
if hasattr(message, 'alternatives') and message.alternatives:
body = message.alternatives[0][0]
Expand Down