From d523d4bb54edc4f6a09dd4747d42c97698cbda10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=9E=E6=B3=95=E6=93=8D=E4=BD=9C?= Date: Wed, 12 Mar 2025 16:34:56 +0800 Subject: [PATCH] fix: can not test custom tool (#15606) --- api/models/tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/models/tools.py b/api/models/tools.py index b941e4ee0f..aef1490729 100644 --- a/api/models/tools.py +++ b/api/models/tools.py @@ -102,6 +102,8 @@ class ApiToolProvider(Base): @property def user(self) -> Account | None: + if not self.user_id: + return None return db.session.query(Account).filter(Account.id == self.user_id).first() @property