mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Fixes the interaction when both splitting and ASN are enabled (#5779)
This commit is contained in:
parent
f6ddcfa839
commit
8d664fad56
@ -100,11 +100,9 @@ class BarcodePlugin(ConsumeTaskPlugin):
|
|||||||
logger.info(f"Found tags in barcode: {tags}")
|
logger.info(f"Found tags in barcode: {tags}")
|
||||||
|
|
||||||
# Lastly attempt to split documents
|
# Lastly attempt to split documents
|
||||||
if settings.CONSUMER_ENABLE_BARCODES:
|
if settings.CONSUMER_ENABLE_BARCODES and (
|
||||||
|
separator_pages := self.get_separation_pages()
|
||||||
separator_pages = self.get_separation_pages()
|
):
|
||||||
if not separator_pages:
|
|
||||||
return "No pages to split on!"
|
|
||||||
|
|
||||||
# We have pages to split against
|
# We have pages to split against
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@ from documents.data_models import ConsumableDocument
|
|||||||
from documents.data_models import DocumentMetadataOverrides
|
from documents.data_models import DocumentMetadataOverrides
|
||||||
from documents.data_models import DocumentSource
|
from documents.data_models import DocumentSource
|
||||||
from documents.models import Tag
|
from documents.models import Tag
|
||||||
|
from documents.plugins.base import StopConsumeTaskError
|
||||||
from documents.tests.utils import DirectoriesMixin
|
from documents.tests.utils import DirectoriesMixin
|
||||||
from documents.tests.utils import DocumentConsumeDelayMixin
|
from documents.tests.utils import DocumentConsumeDelayMixin
|
||||||
from documents.tests.utils import DummyProgressManager
|
from documents.tests.utils import DummyProgressManager
|
||||||
@ -415,7 +416,10 @@ class TestBarcode(
|
|||||||
test_file = self.SAMPLE_DIR / "simple.pdf"
|
test_file = self.SAMPLE_DIR / "simple.pdf"
|
||||||
|
|
||||||
with self.get_reader(test_file) as reader:
|
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(
|
@override_settings(
|
||||||
CONSUMER_ENABLE_BARCODES=True,
|
CONSUMER_ENABLE_BARCODES=True,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user