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
98f68b8b
"src/vscode:/vscode.git/clone" did not exist on "0801ee7dccd8eed9f6fb674cdcce24b2e0ccb46e"
Commit
98f68b8b
authored
Apr 02, 2024
by
Timothy J. Baek
Browse files
refac: shared chat user id
parent
b76e9341
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
backend/apps/web/models/chats.py
backend/apps/web/models/chats.py
+10
-1
No files found.
backend/apps/web/models/chats.py
View file @
98f68b8b
...
...
@@ -108,7 +108,7 @@ class ChatTable:
shared_chat
=
ChatModel
(
**
{
"id"
:
str
(
uuid
.
uuid4
()),
"user_id"
:
"shared"
,
"user_id"
:
f
"shared
-
{
chat_id
}
"
,
"title"
:
chat
.
title
,
"chat"
:
chat
.
chat
,
"timestamp"
:
int
(
time
.
time
()),
...
...
@@ -122,6 +122,15 @@ class ChatTable:
return
shared_chat
if
(
shared_result
and
result
)
else
None
def
delete_shared_chat_by_chat_id
(
self
,
chat_id
:
str
)
->
bool
:
try
:
query
=
Chat
.
delete
().
where
(
Chat
.
user_id
==
f
"shared-
{
chat_id
}
"
)
query
.
execute
()
# Remove the rows, return number of rows removed.
return
True
except
:
return
False
def
update_chat_share_id_by_id
(
self
,
od
:
str
,
share_id
:
Optional
[
str
]
)
->
Optional
[
ChatModel
]:
...
...
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