From dc1e34a1c7f7114adbd0e6e2adcd9f607bdce047 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:48:36 -0800 Subject: [PATCH] Corrects the walrus usage --- src/documents/barcodes.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/documents/barcodes.py b/src/documents/barcodes.py index d2bc76479..5bf622651 100644 --- a/src/documents/barcodes.py +++ b/src/documents/barcodes.py @@ -90,8 +90,7 @@ class BarcodePlugin(ConsumeTaskPlugin): # Update/overwrite an ASN if possible if ( settings.CONSUMER_ENABLE_ASN_BARCODE - and (located_asn := self.asn) - and located_asn is not None + and (located_asn := self.asn) is not None ): logger.info(f"Found ASN in barcode: {located_asn}") self.metadata.asn = located_asn @@ -99,8 +98,7 @@ class BarcodePlugin(ConsumeTaskPlugin): # try reading tags from barcodes if ( settings.CONSUMER_ENABLE_TAG_BARCODE - and (tags := self.tags) - and tags is not None + and (tags := self.tags) is not None and len(tags) > 0 ): if self.metadata.tag_ids: