mirror of
https://github.com/open-webui/open-webui
synced 2025-01-18 08:40:58 +00:00
fix: tools update
This commit is contained in:
parent
489ef9b731
commit
87f656b029
@ -188,10 +188,12 @@ class ToolsTable:
|
||||
def update_tool_by_id(self, id: str, updated: dict) -> Optional[ToolModel]:
|
||||
try:
|
||||
with get_db() as db:
|
||||
tool = db.get(Tool, id)
|
||||
tool.update(**updated)
|
||||
tool.updated_at = int(time.time())
|
||||
db.query(Tool).filter_by(id=id).update(
|
||||
{**updated, "updated_at": int(time.time())}
|
||||
)
|
||||
db.commit()
|
||||
|
||||
tool = db.query(Tool).get(id)
|
||||
db.refresh(tool)
|
||||
return ToolModel.model_validate(tool)
|
||||
except:
|
||||
|
Loading…
Reference in New Issue
Block a user