[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user