mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-01 20:45:35 +00:00
Fix: move re-index after workflow runs on doc edit (#14558)
This commit is contained in:
1 parent
7d8147c21d
commit
d4457efe44
2 files changed
+73
-2
No files matched your search
@@ -1304,13 +1304,19 @@ class DocumentViewSet(
|
||||
|
||||
from documents.search import get_backend
|
||||
|
||||
get_backend().add_or_update(refreshed_doc)
|
||||
|
||||
document_updated.send(
|
||||
sender=self.__class__,
|
||||
document=refreshed_doc,
|
||||
)
|
||||
|
||||
# Index the final workflow state, including deletion.
|
||||
backend = get_backend()
|
||||
final_doc = Document.objects.filter(pk=root_doc.pk).first()
|
||||
if final_doc is None:
|
||||
backend.remove(root_doc.pk)
|
||||
else:
|
||||
backend.add_or_update(final_doc)
|
||||
|
||||
return response
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
|
||||
Reference in new issue
Block a user