[FIX] website_mail: do not reveal full email address in contact name

When subscribing a document, a partner is created based on the email address.
Instead of using the email address as the name (which is a bit too spammer
friendly), only keep the first part of the email address as a name.

Following discussion https://www.odoo.com/groups/59/13640169
This commit is contained in:
Martin Trigaux 2015-08-24 17:01:30 +02:00
parent 2d3973481f
commit 1f57c9a5a6
1 changed files with 2 additions and 1 deletions

View File

@ -46,7 +46,8 @@ class WebsiteMail(http.Controller):
partner_ids = _object._find_partner_from_emails(
cr, SUPERUSER_ID, _id, [email], context=context, check_followers=True)
if not partner_ids or not partner_ids[0]:
partner_ids = [partner_obj.create(cr, SUPERUSER_ID, {'name': email, 'email': email}, context=context)]
name = email.split('@')[0]
partner_ids = [partner_obj.create(cr, SUPERUSER_ID, {'name': name, 'email': email}, context=context)]
# add or remove follower
if _message_is_follower: