From 1f57c9a5a662f4be41b1e08d9cd21061b1c59a64 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Mon, 24 Aug 2015 17:01:30 +0200 Subject: [PATCH] [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 --- addons/website_mail/controllers/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/website_mail/controllers/main.py b/addons/website_mail/controllers/main.py index 18bddd09a58..092465850f0 100644 --- a/addons/website_mail/controllers/main.py +++ b/addons/website_mail/controllers/main.py @@ -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: