Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
87f656b0
Commit
87f656b0
authored
Jul 08, 2024
by
Timothy J. Baek
Browse files
fix: tools update
parent
489ef9b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
backend/apps/webui/models/tools.py
backend/apps/webui/models/tools.py
+5
-3
No files found.
backend/apps/webui/models/tools.py
View file @
87f656b0
...
...
@@ -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
(
{
**
update
d
,
"
updated
_at"
:
int
(
time
.
time
())}
)
db
.
commit
()
tool
=
db
.
query
(
Tool
).
get
(
id
)
db
.
refresh
(
tool
)
return
ToolModel
.
model_validate
(
tool
)
except
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment