diff --git a/src/documents/tasks.py b/src/documents/tasks.py index eff46436e..a5d2d26ca 100644 --- a/src/documents/tasks.py +++ b/src/documents/tasks.py @@ -1,4 +1,7 @@ import logging +import os +import shutil +import tempfile import tqdm from django.conf import settings @@ -14,15 +17,11 @@ from documents.models import Document from documents.models import DocumentType from documents.models import Tag from documents.sanity_checker import SanityCheckFailedException -from whoosh.writing import AsyncWriter - -# barcode decoder -import os -from pyzbar import pyzbar from pdf2image import convert_from_path -import tempfile from pikepdf import Pdf -import shutil +from pyzbar import pyzbar +from whoosh.writing import AsyncWriter +# barcode decoder logger = logging.getLogger("paperless.tasks") diff --git a/src/documents/tests/test_tasks.py b/src/documents/tests/test_tasks.py index a23e00c93..17a36e5cb 100644 --- a/src/documents/tests/test_tasks.py +++ b/src/documents/tests/test_tasks.py @@ -1,4 +1,5 @@ import os +import tempfile from unittest import mock from django.conf import settings @@ -12,9 +13,7 @@ from documents.models import Tag from documents.sanity_checker import SanityCheckFailedException from documents.sanity_checker import SanityCheckMessages from documents.tests.utils import DirectoriesMixin - from PIL import Image -import tempfile class TestTasks(DirectoriesMixin, TestCase):