mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 09:07:18 +01:00
Fix: Crash in barcode ASN reading when the file type isn't supported (#5261)
* Fixes a random crash in the barcode ASN reading so it doesn't try to access a not created temp dir * Don't parse the barcodes twice, store the result instead
This commit is contained in:
parent
a82e3771ae
commit
bd35030c59
2 changed files with 9 additions and 3 deletions
|
|
@ -90,6 +90,9 @@ class BarcodeReader:
|
|||
"""
|
||||
asn = None
|
||||
|
||||
if not self.supported_mime_type:
|
||||
return None
|
||||
|
||||
# Ensure the barcodes have been read
|
||||
self.detect()
|
||||
|
||||
|
|
@ -215,7 +218,7 @@ class BarcodeReader:
|
|||
# This file is really borked, allow the consumption to continue
|
||||
# but it may fail further on
|
||||
except Exception as e: # pragma: no cover
|
||||
logger.warning(
|
||||
logger.exception(
|
||||
f"Exception during barcode scanning: {e}",
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue