mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-20 21:47:01 +01:00
feature: Add support for zxing as barcode scanning lib
This commit is contained in:
parent
7e75193f4a
commit
e89c0f15dd
7 changed files with 102 additions and 14 deletions
|
|
@ -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",
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue