From 84986a72981a590f29a214020f2e23e70d255992 Mon Sep 17 00:00:00 2001 From: Daniel Reis Date: Fri, 19 Mar 2021 22:38:45 +0000 Subject: [PATCH] [FIX] mail_debrand: TypeError: object of type 'NoneType' has no len() --- mail_debrand/models/mail_render_mixinANDmail_mail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mail_debrand/models/mail_render_mixinANDmail_mail.py b/mail_debrand/models/mail_render_mixinANDmail_mail.py index d62f2a8..a63707f 100644 --- a/mail_debrand/models/mail_render_mixinANDmail_mail.py +++ b/mail_debrand/models/mail_render_mixinANDmail_mail.py @@ -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 bytes_text = etree.tostring( previous, pretty_print=True, method="html"