mirror of
https://github.com/open-webui/open-webui
synced 2024-11-25 21:38:43 +00:00
fix: duplicate tags
This commit is contained in:
parent
9d2d53bfb5
commit
cf24a65caa
@ -561,7 +561,7 @@ class ChatTable:
|
||||
if tag_id not in chat.meta.get("tags", []):
|
||||
chat.meta = {
|
||||
**chat.meta,
|
||||
"tags": chat.meta.get("tags", []) + [tag_id],
|
||||
"tags": list(set(chat.meta.get("tags", []) + [tag_id])),
|
||||
}
|
||||
|
||||
db.commit()
|
||||
@ -618,7 +618,7 @@ class ChatTable:
|
||||
tags = [tag for tag in tags if tag != tag_id]
|
||||
chat.meta = {
|
||||
**chat.meta,
|
||||
"tags": tags,
|
||||
"tags": list(set(tags)),
|
||||
}
|
||||
db.commit()
|
||||
return True
|
||||
|
@ -135,7 +135,7 @@ def upgrade():
|
||||
tags = chat_updates[chat_id]["meta"].get("tags", [])
|
||||
tags.append(tag_name)
|
||||
|
||||
chat_updates[chat_id]["meta"]["tags"] = tags
|
||||
chat_updates[chat_id]["meta"]["tags"] = list(set(tags))
|
||||
|
||||
# Update chats based on accumulated changes
|
||||
for chat_id, updates in chat_updates.items():
|
||||
|
Loading…
Reference in New Issue
Block a user