Apply only visible templates

This commit is contained in:
shamoon committed 2026-10-20 11:15:31 -07:00
1 parent 4ff2cb9c72
commit 05da0ba5a3
3 files changed
+28 -13

No files matched your search

+3 -4
View File
@@ -2312,10 +2312,9 @@ class DocumentViewSet(
{"status": "skipped", "reason": "no_document_type", "results": []},
)
templates = OcrTemplate.objects.filter(
document_type_id=document.document_type_id,
enabled=True,
)
from documents.zone_ocr import get_templates_for_document
templates = get_templates_for_document(document)
if not templates.exists():
return Response(
{"status": "skipped", "reason": "no_template", "results": []},