diff options
| author | Aaron Bohy <aab@odoo.com> | 2015-12-16 11:10:30 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2015-12-16 15:48:43 +0100 |
| commit | c58c8f4bd2a4cffa97eaa3cafa9bb46e4be6851b (patch) | |
| tree | c54413a4462ca24279dc637f1ba7311e9c96d9eb /addons/im_livechat/controllers | |
| parent | 0c92788d88b85107ede2457256d906a72a7dd041 (diff) | |
[FIX] im_livechat: use correct url to find rules that apply
The problem was that, when calling 'match_rules()' from the loader template,
we compared the wrong url with the url regexp defined in rules. Indeed, we used
the url of the page we were leaving, not the one we were going to.
We thus need to know if we are coming from the controller, or from the loader
template directly as the way to get the correct url differs.
Courtesy of JEM
Diffstat (limited to 'addons/im_livechat/controllers')
| -rw-r--r-- | addons/im_livechat/controllers/main.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/im_livechat/controllers/main.py b/addons/im_livechat/controllers/main.py index 4b1f5775da9..c8006fd2df1 100644 --- a/addons/im_livechat/controllers/main.py +++ b/addons/im_livechat/controllers/main.py @@ -29,7 +29,7 @@ class LivechatController(http.Controller): def loader(self, channel_id, **kwargs): username = kwargs.get("username", _("Visitor")) channel = request.env['im_livechat.channel'].sudo().browse(channel_id) - info = request.env['im_livechat.channel'].match_rules(request, channel.id, username=username) + info = request.env['im_livechat.channel'].with_context(from_external_page=True).match_rules(request, channel.id, username=username) return request.render('im_livechat.loader', {'info': info, 'web_session_required': True}) if info else False @http.route('/im_livechat/available', type='json', auth="public") |
