From c951b4f26226033e7f47d21292c125be4628fb74 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 11 May 2026 02:29:13 +0900 Subject: [PATCH] chore: format --- backend/open_webui/models/chats.py | 10 ++++------ backend/open_webui/routers/models.py | 15 ++++++--------- backend/open_webui/routers/tools.py | 4 +--- src/lib/components/chat/Artifacts.svelte | 5 ++++- .../chat/Messages/ContentRenderer.svelte | 6 +----- .../components/chat/Messages/UserMessage.svelte | 4 +++- src/lib/i18n/locales/ar-BH/translation.json | 2 ++ src/lib/i18n/locales/ar/translation.json | 2 ++ src/lib/i18n/locales/az-AZ/translation.json | 2 ++ src/lib/i18n/locales/bg-BG/translation.json | 2 ++ src/lib/i18n/locales/bn-BD/translation.json | 2 ++ src/lib/i18n/locales/bo-TB/translation.json | 2 ++ src/lib/i18n/locales/bs-BA/translation.json | 2 ++ src/lib/i18n/locales/ca-ES/translation.json | 2 ++ src/lib/i18n/locales/ceb-PH/translation.json | 2 ++ src/lib/i18n/locales/cs-CZ/translation.json | 2 ++ src/lib/i18n/locales/da-DK/translation.json | 2 ++ src/lib/i18n/locales/de-DE/translation.json | 2 ++ src/lib/i18n/locales/dg-DG/translation.json | 2 ++ src/lib/i18n/locales/el-GR/translation.json | 2 ++ src/lib/i18n/locales/en-GB/translation.json | 2 ++ src/lib/i18n/locales/en-US/translation.json | 2 +- src/lib/i18n/locales/es-ES/translation.json | 2 ++ src/lib/i18n/locales/et-EE/translation.json | 2 ++ src/lib/i18n/locales/eu-ES/translation.json | 2 ++ src/lib/i18n/locales/fa-IR/translation.json | 2 ++ src/lib/i18n/locales/fi-FI/translation.json | 2 ++ src/lib/i18n/locales/fil-PH/translation.json | 2 ++ src/lib/i18n/locales/fr-CA/translation.json | 2 ++ src/lib/i18n/locales/fr-FR/translation.json | 2 ++ src/lib/i18n/locales/gl-ES/translation.json | 2 ++ src/lib/i18n/locales/he-IL/translation.json | 2 ++ src/lib/i18n/locales/hi-IN/translation.json | 2 ++ src/lib/i18n/locales/hr-HR/translation.json | 2 ++ src/lib/i18n/locales/hu-HU/translation.json | 2 ++ src/lib/i18n/locales/id-ID/translation.json | 2 ++ src/lib/i18n/locales/ie-GA/translation.json | 2 ++ src/lib/i18n/locales/it-IT/translation.json | 2 ++ src/lib/i18n/locales/ja-JP/translation.json | 2 ++ src/lib/i18n/locales/ka-GE/translation.json | 2 ++ src/lib/i18n/locales/kab-DZ/translation.json | 2 ++ src/lib/i18n/locales/ko-KR/translation.json | 2 ++ src/lib/i18n/locales/lt-LT/translation.json | 2 ++ src/lib/i18n/locales/lv-LV/translation.json | 2 ++ src/lib/i18n/locales/ms-MY/translation.json | 2 ++ src/lib/i18n/locales/nb-NO/translation.json | 2 ++ src/lib/i18n/locales/nl-NL/translation.json | 2 ++ src/lib/i18n/locales/pa-IN/translation.json | 2 ++ src/lib/i18n/locales/pl-PL/translation.json | 2 ++ src/lib/i18n/locales/pt-BR/translation.json | 2 ++ src/lib/i18n/locales/pt-PT/translation.json | 2 ++ src/lib/i18n/locales/ro-RO/translation.json | 2 ++ src/lib/i18n/locales/ru-RU/translation.json | 2 ++ src/lib/i18n/locales/sk-SK/translation.json | 2 ++ src/lib/i18n/locales/sr-RS/translation.json | 2 ++ src/lib/i18n/locales/sv-SE/translation.json | 2 ++ src/lib/i18n/locales/ta-IN/translation.json | 2 ++ src/lib/i18n/locales/th-TH/translation.json | 2 ++ src/lib/i18n/locales/tk-TM/translation.json | 2 ++ src/lib/i18n/locales/tr-TR/translation.json | 2 ++ src/lib/i18n/locales/ug-CN/translation.json | 2 ++ src/lib/i18n/locales/uk-UA/translation.json | 2 ++ src/lib/i18n/locales/ur-PK/translation.json | 2 ++ src/lib/i18n/locales/uz-Cyrl-UZ/translation.json | 2 ++ src/lib/i18n/locales/uz-Latn-Uz/translation.json | 2 ++ src/lib/i18n/locales/vi-VN/translation.json | 2 ++ src/lib/i18n/locales/zh-CN/translation.json | 2 ++ src/lib/i18n/locales/zh-TW/translation.json | 2 ++ src/lib/utils/csp.ts | 4 +--- 69 files changed, 143 insertions(+), 29 deletions(-) diff --git a/backend/open_webui/models/chats.py b/backend/open_webui/models/chats.py index 51f2f121b3..957492d817 100644 --- a/backend/open_webui/models/chats.py +++ b/backend/open_webui/models/chats.py @@ -471,9 +471,7 @@ class ChatTable: if msg.get('parentId') and msg['parentId'] not in messages_map } - async def backfill_messages_by_chat_id( - self, chat_id: str, user_id: str, messages: dict[str, dict] - ) -> None: + async def backfill_messages_by_chat_id(self, chat_id: str, user_id: str, messages: dict[str, dict]) -> None: """Write messages to the ``chat_message`` table so future lookups use the fast path. Errors are logged but never raised. """ @@ -509,9 +507,9 @@ class ChatTable: # Graph has gaps — enrich from the legacy embedded history. log.info( - 'Chat %s: %d unresolved parent reference(s) in chat_message — ' - 'enriching from legacy history', - id, len(unresolved_ids), + 'Chat %s: %d unresolved parent reference(s) in chat_message — enriching from legacy history', + id, + len(unresolved_ids), ) chat = await self.get_chat_by_id(id) if chat: diff --git a/backend/open_webui/routers/models.py b/backend/open_webui/routers/models.py index cef4429760..2a78daa94d 100644 --- a/backend/open_webui/routers/models.py +++ b/backend/open_webui/routers/models.py @@ -425,15 +425,12 @@ async def get_model_by_id(id: str, user=Depends(get_verified_user), db: AsyncSes ) ) - if ( - write_access - or await AccessGrants.has_access( - user_id=user.id, - resource_type='model', - resource_id=model.id, - permission='read', - db=db, - ) + if write_access or await AccessGrants.has_access( + user_id=user.id, + resource_type='model', + resource_id=model.id, + permission='read', + db=db, ): model_dict = model.model_dump() # Strip params (system prompt and other admin-curated config) diff --git a/backend/open_webui/routers/tools.py b/backend/open_webui/routers/tools.py index 3eddefdee6..cd11bcde5e 100644 --- a/backend/open_webui/routers/tools.py +++ b/backend/open_webui/routers/tools.py @@ -484,9 +484,7 @@ async def update_tools_by_id( if form_data.content != tools.content: if user.role != 'admin' and not ( await has_permission(user.id, 'workspace.tools', request.app.state.config.USER_PERMISSIONS, db=db) - or await has_permission( - user.id, 'workspace.tools_import', request.app.state.config.USER_PERMISSIONS, db=db - ) + or await has_permission(user.id, 'workspace.tools_import', request.app.state.config.USER_PERMISSIONS, db=db) ): raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, diff --git a/src/lib/components/chat/Artifacts.svelte b/src/lib/components/chat/Artifacts.svelte index f8483d122e..f3ac74897d 100644 --- a/src/lib/components/chat/Artifacts.svelte +++ b/src/lib/components/chat/Artifacts.svelte @@ -244,7 +244,10 @@