[FIX] portal: use email_split method to avoid blocking valid emails, rather than obsolete email_re

lp bug: https://launchpad.net/bugs/1199386 fixed

bzr revid: odo@openerp.com-20140115093120-r2u2bmms9y847b93
This commit is contained in:
Olivier Dony 2014-01-15 10:31:20 +01:00
parent 3a95bbaf63
commit b7fe8e1f8a
1 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ import random
from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp.tools import email_re
from openerp.tools import email_split
from openerp import SUPERUSER_ID
_logger = logging.getLogger(__name__)
@ -53,8 +53,8 @@ http://www.openerp.com
def extract_email(email):
""" extract the email address from a user-friendly email address """
m = email_re.search(email or "")
return m and m.group(0) or ""
addresses = email_split(email)
return addresses[0] if addresses else ''