fixup: break up complex if condition

This commit is contained in:
Erik Arvstedt 2018-05-21 00:35:33 +02:00
parent 7e1d59377a
commit 3e8038577d

View File

@ -75,9 +75,11 @@ class Message(Loggable):
continue continue
dispositions = content_disposition.strip().split(";") dispositions = content_disposition.strip().split(";")
if len(dispositions) < 2 or \ if len(dispositions) < 2:
(not dispositions[0].lower() == "attachment" and continue
"filename" not in dispositions[1].lower()):
if not dispositions[0].lower() == "attachment" and \
"filename" not in dispositions[1].lower():
continue continue
file_data = part.get_payload() file_data = part.get_payload()