[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",
|
"name": "Email tracking",
|
||||||
"summary": "Email tracking system for all mails sent",
|
"summary": "Email tracking system for all mails sent",
|
||||||
"version": "13.0.1.0.4",
|
"version": "13.0.1.0.5",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
"website": "http://github.com/OCA/social",
|
"website": "http://github.com/OCA/social",
|
||||||
"author": ("Tecnativa, " "Odoo Community Association (OCA)"),
|
"author": ("Tecnativa, " "Odoo Community Association (OCA)"),
|
||||||
|
@ -23,7 +23,7 @@ class IrMailServer(models.Model):
|
|||||||
body = body or ""
|
body = body or ""
|
||||||
# https://regex101.com/r/lW4cB1/2
|
# https://regex101.com/r/lW4cB1/2
|
||||||
match = re.search(r'<img[^>]*data-odoo-tracking-email=["\']([0-9]*)["\']', body)
|
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(
|
def build_email(
|
||||||
self,
|
self,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user