summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/controllers/main.py
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2018-05-25 11:03:31 +0200
committerNicolas Lempereur <nle@odoo.com>2018-05-25 12:16:30 +0200
commit7703f1fb160b548130756e7e90bba093ab610158 (patch)
treee76b6ca3e77255686c6fcba4d7b3450cf6a828f9 /addons/mass_mailing/controllers/main.py
parent2ca72960001b83c774b00e271266d9326dd5fe04 (diff)
[FIX] mass_mailing: have unsubscribe in multi lang
Since 953a693df link not corresponding to a route are tought multilang by default. Thus in the mass mailing, if the user had not the default language on the website he would have eg. a /fr_FR/unsubscribe_from_list placeholder in the mail. The placeholder is replaced by a real link pinpointing to the items the given person would unsubscribe to, but having /fr_FR/ part prevented that. With this PR, there is a dummy route so /unsubscribe_from_list is explicitely known as not multilang. opw-1850696 closes #24912 Co-authored-by: Goffin Simon <sig@odoo.com>
Diffstat (limited to 'addons/mass_mailing/controllers/main.py')
-rw-r--r--addons/mass_mailing/controllers/main.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/addons/mass_mailing/controllers/main.py b/addons/mass_mailing/controllers/main.py
index ab902ee7d75..b642033b35c 100644
--- a/addons/mass_mailing/controllers/main.py
+++ b/addons/mass_mailing/controllers/main.py
@@ -11,6 +11,11 @@ from odoo.tools import consteq
class MassMailController(http.Controller):
+ @http.route(['/unsubscribe_from_list'], type='http', website=True, multilang=False, auth='public')
+ def unsubscribe_placeholder_link(self, **post):
+ """Dummy route so placeholder is not prefixed by language, MUST have multilang=False"""
+ raise werkzeug.exceptions.NotFound()
+
@http.route(['/mail/mailing/<int:mailing_id>/unsubscribe'], type='http', website=True, auth='public')
def mailing(self, mailing_id, email=None, res_id=None, token="", **post):
mailing = request.env['mail.mass_mailing'].sudo().browse(mailing_id)