[FIX] bus: websocket http raise sessionExpired

The session used to call this websocket route needs to have been
initiated with a call to /websocket/peek_notifications first.

closes odoo/odoo#102009

X-original-commit: 49aa391b4ef93b2de578c73a1fe852cea32abb43
Signed-off-by: Julien Castiaux <juc@odoo.com>
This commit is contained in:
Denis Vermylen
2022-10-05 21:28:00 +02:00
parent 46e2d9e09c
commit 66264a8d86
+2
View File
@@ -49,6 +49,8 @@ class WebsocketController(Controller):
@route('/websocket/update_bus_presence', type='json', auth='public', cors='*')
def update_bus_presence(self, inactivity_period, im_status_ids_by_model):
if 'is_websocket_session' not in request.session:
raise SessionExpiredException()
request.env['ir.websocket']._update_bus_presence(int(inactivity_period), im_status_ids_by_model)
return {}