Skip to content

Commit 7059fdd

Browse files
committed
[FIX] mail: websocket HTTP routes for guests
When contacting the server through the /websocket route, self.env.uid is never set for the public user as we don't go through the `_auth_method_public` method. But through HTTP, it is set which is why guests were not subscribed to their channels as their self.env.uid corresponded to the public user. So we use request.session.uid instead, which remains unset for public users. closes odoo#114634 Signed-off-by: Denis Vermylen (dve) <dve@odoo.com>
1 parent 274ef56 commit 7059fdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

addons/mail/models/ir_websocket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _build_bus_channel_list(self, channels):
2424
channels = list(channels) # do not alter original list
2525
guest_sudo = self.env['mail.guest']._get_guest_from_request(req).sudo()
2626
mail_channels = self.env['mail.channel']
27-
if self.env.uid:
27+
if req.session.uid:
2828
partner = self.env.user.partner_id
2929
mail_channels = partner.channel_ids
3030
channels.append(partner)

0 commit comments

Comments
 (0)