[FIX] mail_debrand: TypeError: object of type 'NoneType' has no len()

This commit is contained in:
Daniel Reis 2021-03-19 22:38:45 +00:00 committed by AlvaroTForgeFlow
parent 7f6b13b660
commit 84986a7298

View File

@ -28,7 +28,7 @@ class MailRenderMixin(models.AbstractModel):
parent = elem.getparent()
previous = elem.getprevious()
if remove_before and not remove_parent and len(previous):
if remove_before and not remove_parent and previous:
# remove 'using' that is before <a and after </span>
bytes_text = etree.tostring(
previous, pretty_print=True, method="html"