From 66e557b6c08561b3cf662db8548253b47350a5a6 Mon Sep 17 00:00:00 2001 From: Yongteng Lei Date: Mon, 24 Mar 2025 15:37:14 +0800 Subject: [PATCH] Fix: Langfuse update model has no fields attribute (#6453) ### What problem does this PR solve? Langfuse update model has no fields attribute ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- api/db/services/langfuse_service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/db/services/langfuse_service.py b/api/db/services/langfuse_service.py index 6c94d13ce..0c4427624 100644 --- a/api/db/services/langfuse_service.py +++ b/api/db/services/langfuse_service.py @@ -43,8 +43,9 @@ class TenantLangfuseService(CommonService): @classmethod def update_by_tenant(cls, tenant_id, langfuse_keys): - fields = ["tenant_id", "host", "secret_key", "public_key"] - return cls.model.update(**langfuse_keys).fields(*fields).where(cls.model.tenant_id == tenant_id).execute() + langfuse_keys["update_time"] = current_timestamp() + langfuse_keys["update_date"] = datetime_format(datetime.now()) + return cls.model.update(**langfuse_keys).where(cls.model.tenant_id == tenant_id).execute() @classmethod def save(cls, **kwargs):