From 67e79d0e19930dd259c50fd4da590c5004337e4e Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 27 Nov 2018 17:15:38 -0400 Subject: [PATCH] OCR, Parsing: Revert iterator stop Revert how the OCR and document parsing generators end their iteration. Originally they issue an empty return, then a blank yield was added. This commit reverts the blank yield and restores the original 'return' behavior. Signed-off-by: Roberto Rosario --- mayan/apps/document_parsing/utils.py | 2 +- mayan/apps/ocr/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mayan/apps/document_parsing/utils.py b/mayan/apps/document_parsing/utils.py index ce3048dea5..ac98780fee 100644 --- a/mayan/apps/document_parsing/utils.py +++ b/mayan/apps/document_parsing/utils.py @@ -14,7 +14,7 @@ def get_document_content(document): try: page_content = page.content.content except DocumentPageContent.DoesNotExist: - yield '' + return else: yield conditional_escape(force_text(page_content)) diff --git a/mayan/apps/ocr/utils.py b/mayan/apps/ocr/utils.py index 304e497da1..ab40b0d040 100644 --- a/mayan/apps/ocr/utils.py +++ b/mayan/apps/ocr/utils.py @@ -13,7 +13,7 @@ def get_document_ocr_content(document): try: page_content = page.ocr_content.content except DocumentPageOCRContent.DoesNotExist: - yield '' + return else: yield force_text(page_content)