diff --git a/api/core/ops/ops_trace_manager.py b/api/core/ops/ops_trace_manager.py index 1069889abd..b7799ce1fb 100644 --- a/api/core/ops/ops_trace_manager.py +++ b/api/core/ops/ops_trace_manager.py @@ -445,7 +445,7 @@ class TraceTask: "ls_provider": message_data.model_provider, "ls_model_name": message_data.model_id, "status": message_data.status, - "from_end_user_id": message_data.from_account_id, + "from_end_user_id": message_data.from_end_user_id, "from_account_id": message_data.from_account_id, "agent_based": message_data.agent_based, "workflow_run_id": message_data.workflow_run_id, @@ -521,7 +521,7 @@ class TraceTask: "ls_provider": message_data.model_provider, "ls_model_name": message_data.model_id, "status": message_data.status, - "from_end_user_id": message_data.from_account_id, + "from_end_user_id": message_data.from_end_user_id, "from_account_id": message_data.from_account_id, "agent_based": message_data.agent_based, "workflow_run_id": message_data.workflow_run_id, @@ -570,7 +570,7 @@ class TraceTask: "ls_provider": message_data.model_provider, "ls_model_name": message_data.model_id, "status": message_data.status, - "from_end_user_id": message_data.from_account_id, + "from_end_user_id": message_data.from_end_user_id, "from_account_id": message_data.from_account_id, "agent_based": message_data.agent_based, "workflow_run_id": message_data.workflow_run_id, diff --git a/api/libs/helper.py b/api/libs/helper.py index 023240a9a4..b98a4829e8 100644 --- a/api/libs/helper.py +++ b/api/libs/helper.py @@ -31,12 +31,12 @@ class AppIconUrlField(fields.Raw): if obj is None: return None - from models.model import App, IconType + from models.model import App, IconType, Site if isinstance(obj, dict) and "app" in obj: obj = obj["app"] - if isinstance(obj, App) and obj.icon_type == IconType.IMAGE.value: + if isinstance(obj, App | Site) and obj.icon_type == IconType.IMAGE.value: return file_helpers.get_signed_file_url(obj.icon) return None diff --git a/web/app/components/explore/app-list/index.tsx b/web/app/components/explore/app-list/index.tsx index bd50708cb4..b8e7939328 100644 --- a/web/app/components/explore/app-list/index.tsx +++ b/web/app/components/explore/app-list/index.tsx @@ -145,7 +145,7 @@ const Apps = ({ if (onSuccess) onSuccess() localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1') - getRedirection(isCurrentWorkspaceEditor, app, push) + getRedirection(isCurrentWorkspaceEditor, { id: app.app_id }, push) } catch (e) { Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) diff --git a/web/utils/app-redirection.ts b/web/utils/app-redirection.ts index b14f660e63..534b019250 100644 --- a/web/utils/app-redirection.ts +++ b/web/utils/app-redirection.ts @@ -4,12 +4,12 @@ export const getRedirection = ( redirectionFunc: (href: string) => void, ) => { if (!isCurrentWorkspaceEditor) { - redirectionFunc(`/app/${app.app_id}/overview`) + redirectionFunc(`/app/${app.id}/overview`) } else { if (app.mode === 'workflow' || app.mode === 'advanced-chat') - redirectionFunc(`/app/${app.app_id}/workflow`) + redirectionFunc(`/app/${app.id}/workflow`) else - redirectionFunc(`/app/${app.app_id}/configuration`) + redirectionFunc(`/app/${app.id}/configuration`) } }