Commit fdb0f6c9 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

fixup! mixin/mail_message: more robust algorythm to choose the first preferred text format part.

parent 57bb2836
...@@ -92,7 +92,6 @@ class MailMessageMixin: ...@@ -92,7 +92,6 @@ class MailMessageMixin:
if part.is_multipart(): if part.is_multipart():
if part.get_content_subtype() in ('alternative', 'mixed', 'related'): if part.get_content_subtype() in ('alternative', 'mixed', 'related'):
# Try to get the favourite text format defined on preference # Try to get the favourite text format defined on preference
favourite_part = None
for subpart in part.get_payload(): for subpart in part.get_payload():
if subpart.get_content_maintype() == 'text' and not subpart.get_filename(): if subpart.get_content_maintype() == 'text' and not subpart.get_filename():
if subpart.get_content_type() == preferred_content_type: if subpart.get_content_type() == preferred_content_type:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment