summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/controllers/main.py
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-10-29 14:23:16 +0000
committerThibault Delavallée <tde@odoo.com>2019-01-14 10:34:26 +0000
commitb670911a92883ebea49d427acafe2abac2753ace (patch)
tree72c4e143401d10882813702b85b6261718b36ec0 /addons/mass_mailing/controllers/main.py
parent75638ffb94fa4ae1753f733d8cb6f7f58f0b6a0a (diff)
[REF] link_tracker, mass_mailing: simplify add_click method and add tests
In this commit we rewrite a bit add_click in order to remove the inlined sudo and ease inheritance and parameter management inside the method. Access through controllers is sudo-ed as the main API method is now done with current user access rights. This commit is linked to task ID 1904277 and PR #28242.
Diffstat (limited to 'addons/mass_mailing/controllers/main.py')
-rw-r--r--addons/mass_mailing/controllers/main.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/addons/mass_mailing/controllers/main.py b/addons/mass_mailing/controllers/main.py
index 440def20462..3c75c7934a3 100644
--- a/addons/mass_mailing/controllers/main.py
+++ b/addons/mass_mailing/controllers/main.py
@@ -107,7 +107,12 @@ class MassMailController(http.Controller):
# which mass_mailing doesn't depend on
country_code = request.session.get('geoip', False) and request.session.geoip.get('country_code', False)
- request.env['link.tracker.click'].sudo().add_click(code, request.httprequest.remote_addr, country_code, stat_id=stat_id)
+ request.env['link.tracker.click'].sudo().add_click(
+ code,
+ ip=request.httprequest.remote_addr,
+ country_code=country_code,
+ mail_stat_id=stat_id
+ )
return werkzeug.utils.redirect(request.env['link.tracker'].get_url_from_code(code), 301)
@http.route('/mailing/blacklist/check', type='json', auth='none')