summaryrefslogtreecommitdiff
path: root/addons/mass_mailing/controllers
diff options
context:
space:
mode:
authorThibault Delavallée <tde@odoo.com>2018-10-19 10:46:26 +0000
committerThibault Delavallée <tde@odoo.com>2019-01-14 10:34:21 +0000
commit75638ffb94fa4ae1753f733d8cb6f7f58f0b6a0a (patch)
tree76f8d0e34cf9d201e2a0f284bb17163fa82e5324 /addons/mass_mailing/controllers
parent9ee9724a10fc5e835d8d42da0e9e83fe687848d8 (diff)
[REF] link_tracker: do not let public read technical / private link data
Link tracker models are rather technical and should not be accessed as it is by external people. Let us delegate control to controllers and lessen a bit model accessibility. Currently everyone can use add_click method and generate statistics. Now statistics will be generated only through dedicated routes. It will make statistics more reliable and ensure technical data remain private. Next commit will update code from controllers and main methods in order to be have a more readable click API and avoid link between non dependent modules. This commit is linked to task ID 1904277 and PR #28242.
Diffstat (limited to 'addons/mass_mailing/controllers')
-rw-r--r--addons/mass_mailing/controllers/main.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mass_mailing/controllers/main.py b/addons/mass_mailing/controllers/main.py
index 11b05685a06..440def20462 100644
--- a/addons/mass_mailing/controllers/main.py
+++ b/addons/mass_mailing/controllers/main.py
@@ -107,7 +107,7 @@ 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'].add_click(code, request.httprequest.remote_addr, country_code, stat_id=stat_id)
+ request.env['link.tracker.click'].sudo().add_click(code, request.httprequest.remote_addr, country_code, 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')