mirror of
https://github.com/imartinez/privateGPT.git
synced 2025-07-01 17:52:17 +00:00
small update in delete
This commit is contained in:
parent
cafc9eb8a8
commit
5c92f23e6a
@ -151,7 +151,8 @@ def delete_file(
|
||||
for doc_id in doc_ids:
|
||||
service.delete(doc_id)
|
||||
document = crud.documents.get_by_filename(db,file_name=filename)
|
||||
crud.documents.remove(db=db, id=document.id)
|
||||
if document:
|
||||
crud.documents.remove(db=db, id=document.id)
|
||||
return {"status": "SUCCESS", "message": f"{filename}' successfully deleted."}
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
|
Loading…
Reference in New Issue
Block a user