mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 00:57:09 +01:00
move the two post bulk edit tasks into one
This commit is contained in:
parent
7beb8a0929
commit
3d173a13ab
3 changed files with 30 additions and 49 deletions
|
|
@ -90,16 +90,11 @@ def sanity_check():
|
|||
return "No issues detected."
|
||||
|
||||
|
||||
def bulk_rename_files(document_ids):
|
||||
qs = Document.objects.filter(id__in=document_ids)
|
||||
for doc in qs:
|
||||
post_save.send(Document, instance=doc, created=False)
|
||||
|
||||
|
||||
def bulk_index_documents(document_ids):
|
||||
def bulk_update_documents(document_ids):
|
||||
documents = Document.objects.filter(id__in=document_ids)
|
||||
|
||||
ix = index.open_index()
|
||||
with AsyncWriter(ix) as writer:
|
||||
for doc in documents:
|
||||
index.update_document(writer, doc)
|
||||
post_save.send(Document, instance=doc, created=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue