[FIX]mail: fix help command in livechat with unlogged user
When an unlogged user creates a livechat, typing the /help command in the backend would result in the help command sending a traceback. The function processing the command would assume the existence of a channel partner name, which is not the case when the user starting the chat is unlogged. opw:1835484
This commit is contained in:
@@ -648,7 +648,7 @@ class Channel(models.Model):
|
||||
msg += _(" This channel is private. People must be invited to join it.")
|
||||
else:
|
||||
channel_partners = self.env['mail.channel.partner'].search([('partner_id', '!=', partner.id), ('channel_id', '=', self.id)])
|
||||
msg = _("You are in a private conversation with <b>@%s</b>.") % channel_partners[0].partner_id.name
|
||||
msg = _("You are in a private conversation with <b>@%s</b>.") % (channel_partners[0].partner_id.name if channel_partners else _('Anonymous'))
|
||||
msg += _("""<br><br>
|
||||
You can mention someone by typing <b>@username</b>, this will grab its attention.<br>
|
||||
You can mention a channel by typing <b>#channel</b>.<br>
|
||||
|
||||
Reference in New Issue
Block a user