A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Fixes the interaction when both splitting and ASN are enabled (#5779)
Trenton H8d664fad5685
diff --git a/src/documents/barcodes.py b/src/documents/barcodes.pyindex fe1e94b8a..e68ba4f8c 100644--- a/src/documents/barcodes.py+++ b/src/documents/barcodes.py@@ -100,11 +100,9 @@ class BarcodePlugin(ConsumeTaskPlugin):logger.info(f"Found tags in barcode: {tags}")# Lastly attempt to split documents- if settings.CONSUMER_ENABLE_BARCODES:-- separator_pages = self.get_separation_pages()- if not separator_pages:- return "No pages to split on!"+ if settings.CONSUMER_ENABLE_BARCODES and (+ separator_pages := self.get_separation_pages()+ ):# We have pages to split againstdiff --git a/src/documents/tests/test_barcodes.py b/src/documents/tests/test_barcodes.pyindex 732c2e167..2f4f5cd39 100644--- a/src/documents/tests/test_barcodes.py+++ b/src/documents/tests/test_barcodes.py@@ -15,6 +15,7 @@ from documents.data_models import ConsumableDocumentfrom documents.data_models import DocumentMetadataOverridesfrom documents.data_models import DocumentSourcefrom documents.models import Tag+from documents.plugins.base import StopConsumeTaskErrorfrom documents.tests.utils import DirectoriesMixinfrom documents.tests.utils import DocumentConsumeDelayMixinfrom documents.tests.utils import DummyProgressManager@@ -415,7 +416,10 @@ class TestBarcode(test_file = self.SAMPLE_DIR / "simple.pdf"with self.get_reader(test_file) as reader:- self.assertEqual("No pages to split on!", reader.run())+ try:+ reader.run()+ except StopConsumeTaskError:+ self.fail("Barcode reader split pages unexpectedly")@override_settings(CONSUMER_ENABLE_BARCODES=True,