summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorguce <guce@odoo.com>2025-02-03 10:30:15 +0000
committerguce <guce@odoo.com>2025-02-05 08:13:27 +0000
commit3230501d4a70488a2c3a13ba8bde66640b86227d (patch)
tree10fbc23074b31954cbc62fb540fc91a626567ef6
parent94ed7173de4d6a73c5cfa6843b3628084248f18d (diff)
[FIX] mass_mailing: make unsubcription page work in website
A recent change modified the unsubscription flow to make it more resilient to automated security agents. Unfortunately, the implementation of this change breaks if the Website module is installed, and the flow becomes unusable. This commit makes it so that the unsubscription flow works once more, without compromising on resilience to security agents. task-4364446 closes odoo/odoo#196366 X-original-commit: 35a4265705f2e19b96325f44afe5c706ce98ea63 Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
-rw-r--r--addons/mass_mailing/controllers/main.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/mass_mailing/controllers/main.py b/addons/mass_mailing/controllers/main.py
index 71bd1a8e441..0da3d07bf80 100644
--- a/addons/mass_mailing/controllers/main.py
+++ b/addons/mass_mailing/controllers/main.py
@@ -150,7 +150,8 @@ class MassMailController(http.Controller):
</div>
</t>
""")
- return request.render(template, {
+ return request.env['ir.qweb']._render(template, {
+ 'main_object': mailing,
'mailing_id': mailing_id,
'document_id': document_id,
'email': email,
@@ -200,7 +201,8 @@ class MassMailController(http.Controller):
</div>
</t>
""")
- return request.render(template, {
+ return request.env['ir.qweb']._render(template, {
+ 'main_object': request.env['mailing.mailing'].browse(int(mailing_id)),
'settings_url': settings_url,
'success_str': _('Successfully unsubscribed!'),
'manage_btn': _('Manage Subscriptions'),