[REF] mail_debrand: Fix FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.

This commit is contained in:
Moisés López 2021-08-29 14:30:32 -05:00 committed by AlvaroTForgeFlow
parent 705138dce1
commit caf5fd4f6d

View File

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