[FIX] re.search will return None when nothing found. So we have to check for this
This commit is contained in:
parent
399e4fad0c
commit
26c6cd33af
@ -7,7 +7,7 @@
|
||||
{
|
||||
"name": "Email tracking",
|
||||
"summary": "Email tracking system for all mails sent",
|
||||
"version": "13.0.1.0.4",
|
||||
"version": "13.0.1.0.5",
|
||||
"category": "Social Network",
|
||||
"website": "http://github.com/OCA/social",
|
||||
"author": ("Tecnativa, " "Odoo Community Association (OCA)"),
|
||||
|
@ -23,7 +23,7 @@ class IrMailServer(models.Model):
|
||||
body = body or ""
|
||||
# https://regex101.com/r/lW4cB1/2
|
||||
match = re.search(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,
|
||||
|
Loading…
Reference in New Issue
Block a user