fixed regular expression to support Unicode and improve readability

This commit is contained in:
eukub 2023-12-24 21:44:41 +03:00
parent 74e89b0ee3
commit 408dfc11ed

View File

@ -105,7 +105,7 @@ class BarcodeReader:
asn_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)
asn_text = re.sub(r"\D", "", asn_text)
# now, try parsing the ASN number
try: