[FIX] mail: mails fetch

`node.get('class', '')` returns a `Nonetype`
in some cases, and, therefore,
`'o_mail_notification' in node.get('class', '')`
throws a
`TypeError: argument of type 'NoneType' is not iterable`.

Replacing by `(node.get('class') or '')` keep the behavior
that was expected, but will prevent to have a `Nonetype`

opw-656508
opw-656753
opw-653965
This commit is contained in:
Denis Ledoux
2015-11-18 17:02:13 +01:00
parent 2fc6e94d8a
commit 49a0eae805
+1 -1
View File
@@ -1239,7 +1239,7 @@ class MailThread(models.AbstractModel):
root = lxml.html.fromstring(body)
postprocessed = False
for node in root.iter():
if 'o_mail_notification' in node.get('class', '') or 'o_mail_notification' in node.get('summary', ''):
if 'o_mail_notification' in (node.get('class') or '') or 'o_mail_notification' in (node.get('summary') or ''):
postprocessed = True
node.getparent().remove(node)
if postprocessed: