summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Trigaux <mat@odoo.com>2016-01-06 08:20:07 +0100
committerMartin Trigaux <mat@odoo.com>2016-01-06 08:20:48 +0100
commit136c563bc6c7c7325cd1f785024e7e047e684cdd (patch)
tree8f16a0479776b6744c679c5d5bd0d911f5328a92
parentc7d281d8462eaaa5c1074f35ea85bc9202ed6ba7 (diff)
[FIX] mass_mailing: duplicated regex
-rw-r--r--addons/mass_mailing/models/mail_mail.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/addons/mass_mailing/models/mail_mail.py b/addons/mass_mailing/models/mail_mail.py
index 87be8836616..e9edd3a9824 100644
--- a/addons/mass_mailing/models/mail_mail.py
+++ b/addons/mass_mailing/models/mail_mail.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+import re
import urlparse
import werkzeug.urls
@@ -84,14 +85,6 @@ class MailMail(osv.Model):
body = re.sub('(<img(?=\s)[^>]*\ssrc=")(/[^/][^"]+)', _sub_relative2absolute, body)
body = re.sub(r'(<[^>]+\bstyle="[^"]+\burl\(\'?)(/[^/\'][^\'")]+)', _sub_relative2absolute, body)
- # resolve relative image url to absolute for outlook.com
- def _sub_relative2absolute(match):
- return match.group(1) + urlparse.urljoin(domain, match.group(2))
- # Regex: https://regex101.com/r/aE8uG5/3
- body = re.sub('(<img(?=\s)[^>]*\ssrc=["\'])(/[^/][^"\']+)', _sub_relative2absolute, body)
- # Regex: https://regex101.com/r/kT3lD5/2
- body = re.sub(r'(<[^>]+\bstyle=["\'][^"\']+\burl\([\'"]?)(/[^/\'"][^\'")]+)', _sub_relative2absolute, body)
-
# generate tracking URL
if mail.statistics_ids:
tracking_url = self._get_tracking_url(cr, uid, mail, partner, context=context)