[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:
parent
2d3973481f
commit
1f57c9a5a6
|
@ -46,7 +46,8 @@ class WebsiteMail(http.Controller):
|
||||||
partner_ids = _object._find_partner_from_emails(
|
partner_ids = _object._find_partner_from_emails(
|
||||||
cr, SUPERUSER_ID, _id, [email], context=context, check_followers=True)
|
cr, SUPERUSER_ID, _id, [email], context=context, check_followers=True)
|
||||||
if not partner_ids or not partner_ids[0]:
|
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
|
# add or remove follower
|
||||||
if _message_is_follower:
|
if _message_is_follower:
|
||||||
|
|
Loading…
Reference in New Issue