Issue #75, move OCR queueing from a setting to a DocumentType model field

This commit is contained in:
Roberto Rosario
2014-10-21 16:53:42 -04:00
parent 3c72d62087
commit 549f0fdc87
6 changed files with 127 additions and 15 deletions
+1 -2
View File
@@ -20,7 +20,6 @@ from .links import (all_document_ocr_cleanup, ocr_tool_link,
submit_document_multiple)
from .models import DocumentQueue
from .permissions import PERMISSION_OCR_DOCUMENT
from .settings import AUTOMATIC_OCR
from .tasks import task_do_ocr
logger = logging.getLogger(__name__)
@@ -42,7 +41,7 @@ def document_post_save(sender, instance, **kwargs):
logger.debug('received post save signal')
logger.debug('instance: %s' % instance)
if kwargs.get('created', False):
if AUTOMATIC_OCR:
if instance.document.document_type.ocr:
instance.document.submit_for_ocr()