From 391020a2b064bff95fa9116599a36fb11129a214 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Fri, 20 Nov 2020 10:58:17 +0100 Subject: [PATCH] small changes --- src/documents/consumer.py | 6 +++--- src/paperless/settings.py | 18 +++++++++--------- src/paperless_tesseract/parsers.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/documents/consumer.py b/src/documents/consumer.py index 973fff925..8edbb00a3 100755 --- a/src/documents/consumer.py +++ b/src/documents/consumer.py @@ -223,9 +223,9 @@ class Consumer(LoggingMixin): self.log("debug", "Deleting file {}".format(self.path)) os.unlink(self.path) except Exception as e: - raise ConsumerError(e) - self._send_progress(file, 100, 100, 'FAILED', + self._send_progress(self.filename, 100, 100, 'FAILED', "Failed: {}".format(e)) + raise ConsumerError(e) finally: document_parser.cleanup() @@ -234,7 +234,7 @@ class Consumer(LoggingMixin): "Document {} consumption finished".format(document) ) - self._send_progress(file, 100, 100, 'SUCCESS', + self._send_progress(self.filename, 100, 100, 'SUCCESS', 'Finished.', document.id) return document diff --git a/src/paperless/settings.py b/src/paperless/settings.py index cb115739b..37b046b2a 100644 --- a/src/paperless/settings.py +++ b/src/paperless/settings.py @@ -143,6 +143,15 @@ TEMPLATES = [ }, ] +CHANNEL_LAYERS = { + "default": { + "BACKEND": "channels_redis.core.RedisChannelLayer", + "CONFIG": { + "hosts": ["redis://localhost:6379"], + }, + }, +} + ############################################################################### # Security # ############################################################################### @@ -376,12 +385,3 @@ for t in json.loads(os.getenv("PAPERLESS_FILENAME_PARSE_TRANSFORMS", "[]")): # TODO: this should not have a prefix. # Specify the filename format for out files PAPERLESS_FILENAME_FORMAT = os.getenv("PAPERLESS_FILENAME_FORMAT") - -CHANNEL_LAYERS = { - "default": { - "BACKEND": "channels_redis.core.RedisChannelLayer", - "CONFIG": { - "hosts": [("broker", 6379)], - }, - }, -} diff --git a/src/paperless_tesseract/parsers.py b/src/paperless_tesseract/parsers.py index c3715c83a..11a6c8b37 100644 --- a/src/paperless_tesseract/parsers.py +++ b/src/paperless_tesseract/parsers.py @@ -90,7 +90,7 @@ class RasterisedDocumentParser(DocumentParser): self._text = get_text_from_pdf(self.document_path) return self._text - self.progress_callback(0,1,"Making greyscale images.") + self.progress_callback(0, 1, "Making greyscale images.") images = self._get_greyscale() if not images: