Corrects the walrus usage

This commit is contained in:
Trenton H 2024-02-12 12:48:36 -08:00
parent d90ec5bb7f
commit dc1e34a1c7

View File

@ -90,8 +90,7 @@ class BarcodePlugin(ConsumeTaskPlugin):
# Update/overwrite an ASN if possible # Update/overwrite an ASN if possible
if ( if (
settings.CONSUMER_ENABLE_ASN_BARCODE settings.CONSUMER_ENABLE_ASN_BARCODE
and (located_asn := self.asn) and (located_asn := self.asn) is not None
and located_asn is not None
): ):
logger.info(f"Found ASN in barcode: {located_asn}") logger.info(f"Found ASN in barcode: {located_asn}")
self.metadata.asn = located_asn self.metadata.asn = located_asn
@ -99,8 +98,7 @@ class BarcodePlugin(ConsumeTaskPlugin):
# try reading tags from barcodes # try reading tags from barcodes
if ( if (
settings.CONSUMER_ENABLE_TAG_BARCODE settings.CONSUMER_ENABLE_TAG_BARCODE
and (tags := self.tags) and (tags := self.tags) is not None
and tags is not None
and len(tags) > 0 and len(tags) > 0
): ):
if self.metadata.tag_ids: if self.metadata.tag_ids: