1
0
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:
Дилян Палаузов
2018-01-03 18:52:12 -05:00
committed by Tim Graham
parent c2d0f8c084
commit d7b2aa24f7
55 changed files with 98 additions and 218 deletions

View File

@@ -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':