mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #28982 -- Simplified code with and/or.
This commit is contained in:
committed by
Tim Graham
parent
c2d0f8c084
commit
d7b2aa24f7
@@ -309,11 +309,7 @@ class EmailMessage:
|
||||
self.attachments.append(filename)
|
||||
else:
|
||||
assert content is not None
|
||||
|
||||
if not mimetype:
|
||||
mimetype, _ = mimetypes.guess_type(filename)
|
||||
if not mimetype:
|
||||
mimetype = DEFAULT_ATTACHMENT_MIME_TYPE
|
||||
mimetype = mimetype or mimetypes.guess_type(filename)[0] or DEFAULT_ATTACHMENT_MIME_TYPE
|
||||
basetype, subtype = mimetype.split('/', 1)
|
||||
|
||||
if basetype == 'text':
|
||||
|
||||
Reference in New Issue
Block a user