mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #28042 -- Fixed crash when using a two-tuple in EmailMessage's attachments arg.
This commit is contained in:
@@ -236,7 +236,13 @@ class EmailMessage:
|
||||
self.from_email = from_email or settings.DEFAULT_FROM_EMAIL
|
||||
self.subject = subject
|
||||
self.body = body
|
||||
self.attachments = attachments or []
|
||||
self.attachments = []
|
||||
if attachments:
|
||||
for attachment in attachments:
|
||||
if isinstance(attachment, MIMEBase):
|
||||
self.attach(attachment)
|
||||
else:
|
||||
self.attach(*attachment)
|
||||
self.extra_headers = headers or {}
|
||||
self.connection = connection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user