mirror of
https://github.com/open-webui/open-webui
synced 2025-01-31 15:01:00 +00:00
refac
This commit is contained in:
parent
435a174316
commit
a5627d4226
@ -270,16 +270,6 @@ class MessageTable:
|
|||||||
# Delete all reactions to this message
|
# Delete all reactions to this message
|
||||||
db.query(MessageReaction).filter_by(message_id=id).delete()
|
db.query(MessageReaction).filter_by(message_id=id).delete()
|
||||||
|
|
||||||
# List all replies to this message
|
|
||||||
replies = db.query(Message).filter_by(parent_id=id).all()
|
|
||||||
|
|
||||||
# Delete all reactions to each reply
|
|
||||||
for reply in replies:
|
|
||||||
db.query(MessageReaction).filter_by(message_id=reply.id).delete()
|
|
||||||
|
|
||||||
# Delete all replies to this message
|
|
||||||
db.query(Message).filter_by(parent_id=id).delete()
|
|
||||||
|
|
||||||
db.commit()
|
db.commit()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user