A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
barcode logic: strip non-numeric characters from detected ASN string (#4379)
Sebastian Porombka90db397ec657
diff --git a/src/documents/barcodes.py b/src/documents/barcodes.pyindex 89d8c2685..cac02e3e9 100644--- a/src/documents/barcodes.py+++ b/src/documents/barcodes.py@@ -1,4 +1,5 @@import logging+import reimport tempfilefrom dataclasses import dataclassfrom pathlib import Path@@ -100,6 +101,9 @@ class BarcodeReader:# remove the prefix and remove whitespaceasn_text = asn_text[len(settings.CONSUMER_ASN_BARCODE_PREFIX) :].strip()+ # remove non-numeric parts of the remaining string+ asn_text = re.sub("[^0-9]", "", asn_text)+# now, try parsing the ASN numbertry:asn = int(asn_text)