Rewrote if condition

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
Lukas Metzger 2024-09-07 18:17:58 +02:00 committed by GitHub
parent 9ffec3988a
commit cd9707e34a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -238,9 +238,11 @@ class BarcodePlugin(ConsumeTaskPlugin):
logger.debug(f"PDF has {num_of_pages} pages") logger.debug(f"PDF has {num_of_pages} pages")
# Get limit from configuration # Get limit from configuration
barcode_max_pages = settings.CONSUMER_BARCODE_MAX_PAGES barcode_max_pages = (
if barcode_max_pages == 0: num_of_pages
barcode_max_pages = num_of_pages if settings.CONSUMER_BARCODE_MAX_PAGES == 0
else settings.CONSUMER_BARCODE_MAX_PAGES
)
if barcode_max_pages < num_of_pages: if barcode_max_pages < num_of_pages:
logger.debug( logger.debug(