From f4d2c6027ad7a38d2061659b75007b0772c9e294 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 9 Aug 2025 21:10:12 +0400 Subject: [PATCH] refac --- backend/open_webui/main.py | 11 +++++++++++ src/app.css | 10 ++++++++++ src/routes/+layout.svelte | 5 ----- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 5bf71309be..4a05df8256 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -470,6 +470,9 @@ from open_webui.tasks import ( from open_webui.utils.redis import get_sentinels_from_env +from open_webui.constants import ERROR_MESSAGES + + if SAFE_MODE: print("SAFE MODE ENABLED") Functions.deactivate_all_functions() @@ -1423,6 +1426,14 @@ async def chat_completion( ), } + if metadata.get("chat_id") and (user and user.role != "admin"): + chat = Chats.get_chat_by_id_and_user_id(metadata["chat_id"], user.id) + if chat is None: + raise HTTPException( + status_code=status.HTTP_404_NOT_FOUND, + detail=ERROR_MESSAGES.DEFAULT(), + ) + request.state.metadata = metadata form_data["metadata"] = metadata diff --git a/src/app.css b/src/app.css index eb4e149993..7d465210ba 100644 --- a/src/app.css +++ b/src/app.css @@ -627,3 +627,13 @@ input[type='number'] { padding-right: 2px; white-space: nowrap; } + +body { + background: #fff; + color: #000; +} + +.dark body { + background: #171717; + color: #eee; +} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 9af3e1e58d..f0aea21931 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -649,11 +649,6 @@ {$WEBUI_NAME} - - - - {#if loaded}