[FIX] re.search will return None when nothing found. So we have to check for this

pull/631/head
Wolfgang Pichler 2020-10-23 14:16:12 +02:00
parent 16eb1a8c4a
commit d50a8ff4ed
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class IrMailServer(models.Model):
# https://regex101.com/r/lW4cB1/2 # https://regex101.com/r/lW4cB1/2
match = re.search( match = re.search(
r'<img[^>]*data-odoo-tracking-email=["\']([0-9]*)["\']', body) r'<img[^>]*data-odoo-tracking-email=["\']([0-9]*)["\']', body)
return int(match.group(1)) if match.group(1) else False return int(match.group(1)) if match and match.group(1) else False
def build_email(self, email_from, email_to, subject, body, email_cc=None, def build_email(self, email_from, email_to, subject, body, email_cc=None,
email_bcc=None, reply_to=False, attachments=None, email_bcc=None, reply_to=False, attachments=None,