mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
feature: Add support for zxing as barcode scanning lib
This commit is contained in:
@@ -166,4 +166,17 @@ def settings_values_check(app_configs, **kwargs):
|
||||
)
|
||||
return msgs
|
||||
|
||||
return _ocrmypdf_settings_check() + _timezone_validate()
|
||||
def _barcode_scanner_validate():
|
||||
"""
|
||||
Validates the barcode scanner type
|
||||
"""
|
||||
msgs = []
|
||||
if settings.CONSUMER_BARCODE_SCANNER not in ["PYZBAR", "ZXING"]:
|
||||
msgs.append(
|
||||
Error(f'Invalid Barcode Scanner "{settings.CONSUMER_BARCODE_SCANNER}"'),
|
||||
)
|
||||
return msgs
|
||||
|
||||
return (
|
||||
_ocrmypdf_settings_check() + _timezone_validate() + _barcode_scanner_validate()
|
||||
)
|
||||
|
@@ -718,6 +718,12 @@ CONSUMER_BARCODE_STRING: Final[str] = os.getenv(
|
||||
"PATCHT",
|
||||
)
|
||||
|
||||
consumer_barcode_scanner_tmp: Final[str] = os.getenv(
|
||||
"PAPERLESS_CONSUMER_BARCODE_SCANNER",
|
||||
"PYZBAR",
|
||||
)
|
||||
CONSUMER_BARCODE_SCANNER = consumer_barcode_scanner_tmp.upper()
|
||||
|
||||
CONSUMER_ENABLE_ASN_BARCODE: Final[bool] = __get_boolean(
|
||||
"PAPERLESS_CONSUMER_ENABLE_ASN_BARCODE",
|
||||
)
|
||||
|
Reference in New Issue
Block a user