mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-24 08:38:55 +00:00
Remove the handlers, make the matching work
This commit is contained in:
8 files changed
+131
-222
No files matched your search
@@ -1236,19 +1236,10 @@ def remove_doclink(
|
||||
|
||||
def run_zone_ocr(doc_ids: list[int]) -> Literal["OK"]:
|
||||
"""
|
||||
Queue zone OCR for the given documents. Documents whose type has no enabled
|
||||
OCR template are skipped.
|
||||
Queue zone OCR for the given documents. Templates are matched against each
|
||||
document's content when its task runs.
|
||||
"""
|
||||
document_ids = (
|
||||
Document.objects.filter(
|
||||
id__in=doc_ids,
|
||||
document_type__ocr_templates__enabled=True,
|
||||
)
|
||||
.order_by()
|
||||
.values_list("id", flat=True)
|
||||
.distinct()
|
||||
)
|
||||
for document_id in document_ids:
|
||||
for document_id in doc_ids:
|
||||
extract_zones.apply_async(
|
||||
kwargs={"document_id": document_id},
|
||||
headers={"trigger_source": PaperlessTask.TriggerSource.MANUAL},
|
||||
|
||||
Reference in new issue
Block a user