Portal Wizard uses wrong regular expression for emails
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Odoo Addons (MOVED TO GITHUB) |
Fix Released
|
Medium
|
OpenERP R&D Addons Team 1 |
Bug Description
During testing with my email-address '<email address hidden>' I noticed a couple of things:
1. The partner contact with that email-address can't be given access to the portal by the portal wizard, it fails on creation of the user in addons/
if not data.get('login', False):
raise osv.except_
2. The login field is empty, because the portal wizard uses the email field to create a login in addons/
The extract_email function in portal_wizard.py uses 'email_re' to determine what the login field should look like.
'email_re' is defined as in multiple places, which is the first problem. It at least in tools/mail.py and tools/import_
email_re = re.compile(r"""
([a-
@ # mandatory @ sign
[a-
\.
[a-z]{2,3} # TLD
)
""", re.VERBOSE)
Problems I see:
1. The email_re is defined in multiple places; make it one;
2. It forces to have email-addresses with at least 2 characters for the user part, of which the first must contain a letter; addresses like <email address hidden> won't work then; is there a reason for this?
3. the TLD must contain 2 or 3 characters, which is unsuitable for domains like .name or .info
Patch for email regular expression to:
- allow for 1 letter username parts
- support modern TLD (.name and .info for example)