From 27993f4007b506212a8c5086100baada93971be3 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 28 Jul 2025 10:53:02 +0800 Subject: [PATCH] perf: User change ws api --- backend/apps/system/api/user.py | 2 +- backend/locales/en.json | 2 +- backend/locales/zh-CN.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/apps/system/api/user.py b/backend/apps/system/api/user.py index 0880fda8..0cf26d34 100644 --- a/backend/apps/system/api/user.py +++ b/backend/apps/system/api/user.py @@ -101,7 +101,7 @@ async def ws_change(session: SessionDep, current_user: CurrentUser, trans:Trans, if not any(x.id == oid for x in ws_list): db_ws = session.get(WorkspaceModel, oid) if db_ws: - raise Exception(trans('i18n_user.user_ws_miss', msg = db_ws.name)) + raise Exception(trans('i18n_user.ws_miss', ws = db_ws.name)) raise Exception(trans('i18n_not_exist', msg = f"{trans('i18n_ws.title')}[{oid}]")) user_model: UserModel = get_db_user(session = session, user_id = current_user.id) user_model.oid = oid diff --git a/backend/locales/en.json b/backend/locales/en.json index d5dec7f4..7b775419 100644 --- a/backend/locales/en.json +++ b/backend/locales/en.json @@ -17,7 +17,7 @@ "email": "Email", "password": "Password", "language_not_support": "System does not support [{key}] language!", - "user_ws_miss:": "The current user is not in the workspace [{msg}]!" + "ws_miss": "The current user is not in the workspace [{ws}]!" }, "i18n_ws": { "title": "Workspace" diff --git a/backend/locales/zh-CN.json b/backend/locales/zh-CN.json index c47a7859..abadd609 100644 --- a/backend/locales/zh-CN.json +++ b/backend/locales/zh-CN.json @@ -17,7 +17,7 @@ "email": "邮箱", "password": "密码", "language_not_support": "系统不支持[{key}]语言!", - "user_ws_miss:": "当前用户不在工作空间[{msg}]中!" + "ws_miss": "当前用户不在工作空间[{ws}]中!" }, "i18n_ws": { "title": "工作空间"