From 3e8038577d86845a62833bf6ddd53a6743d1b36d Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 21 May 2018 00:35:33 +0200 Subject: [PATCH] fixup: break up complex if condition --- src/documents/mail.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/documents/mail.py b/src/documents/mail.py index d974d57c5..9a1c792aa 100644 --- a/src/documents/mail.py +++ b/src/documents/mail.py @@ -75,9 +75,11 @@ class Message(Loggable): continue dispositions = content_disposition.strip().split(";") - if len(dispositions) < 2 or \ - (not dispositions[0].lower() == "attachment" and - "filename" not in dispositions[1].lower()): + if len(dispositions) < 2: + continue + + if not dispositions[0].lower() == "attachment" and \ + "filename" not in dispositions[1].lower(): continue file_data = part.get_payload()