Fix: deselect and trigger refresh for deleted documents from bulk operations with "delete originals" (#8996)

This commit is contained in:
shamoon
2025-02-06 16:47:50 -08:00
committed by GitHub
parent 046d8456e2
commit 52ab07c673
24 changed files with 897 additions and 664 deletions

View File

@@ -24,6 +24,7 @@ from documents.models import Document
from documents.models import DocumentType
from documents.models import StoragePath
from documents.permissions import set_permissions_for_object
from documents.plugins.helpers import DocumentsStatusManager
from documents.tasks import bulk_update_documents
from documents.tasks import consume_file
from documents.tasks import update_document_content_maybe_archive_file
@@ -219,6 +220,9 @@ def delete(doc_ids: list[int]) -> Literal["OK"]:
with index.open_index_writer() as writer:
for id in doc_ids:
index.remove_document_by_id(writer, id)
status_mgr = DocumentsStatusManager()
status_mgr.send_documents_deleted(doc_ids)
except Exception as e:
if "Data too long for column" in str(e):
logger.warning(