fix: update delete brain logic (#1619)

This commit is contained in:
Mamadou DICKO 2023-11-13 15:02:10 +01:00 committed by GitHub
parent 6bc9dd1894
commit 5e61445fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -107,7 +107,8 @@ class Knowledges(Repository):
if knowledge.file_name:
knowledge_to_delete_list.append(f"{brain_id}/{knowledge.file_name}")
self.db.storage.from_("quivr").remove(knowledge_to_delete_list)
if knowledge_to_delete_list:
self.db.storage.from_("quivr").remove(knowledge_to_delete_list)
self.db.from_("knowledge").delete().filter(
"brain_id", "eq", str(brain_id)