mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: chat links in finished and failed webhook notifications open a 404 (#31572)
The link in "chat finished" and "chat failed" webhook notifications was missing the `/c/` part of the chat address, so clicking it opened a 404 page. The link is sent as `/c/<chat id>` again and opens the chat. Fixes #31565
This commit is contained in:
parent
c488f60e8b
commit
b6dfa3799d
1 changed files with 0 additions and 6 deletions
|
|
@ -268,9 +268,6 @@ def _notification_webhook_content(event: Any) -> tuple[str, str, dict[str, Any],
|
|||
title = str(data.get('title') or event.message or 'Chat finished')
|
||||
content = str(data.get('message') or '')
|
||||
url = str(data.get('url') or '')
|
||||
chat_id = str(data.get('chat_id') or '')
|
||||
if chat_id and url.endswith(f'/c/{chat_id}'):
|
||||
url = f'{url[: -len(f"/c/{chat_id}")].rstrip("/")}/{chat_id}'
|
||||
body = '\n'.join(part for part in (content, url) if part)
|
||||
return (
|
||||
f'**{title}**',
|
||||
|
|
@ -288,9 +285,6 @@ def _notification_webhook_content(event: Any) -> tuple[str, str, dict[str, Any],
|
|||
title = str(event.message or 'Chat failed')
|
||||
content = str(data.get('message') or '')
|
||||
url = str(data.get('url') or '')
|
||||
chat_id = str(data.get('chat_id') or '')
|
||||
if chat_id and url.endswith(f'/c/{chat_id}'):
|
||||
url = f'{url[: -len(f"/c/{chat_id}")].rstrip("/")}/{chat_id}'
|
||||
body = '\n'.join(part for part in (content, url) if part)
|
||||
return (
|
||||
f'**{title}**',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue