2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 12:06:44 +00:00

Fix uncaught Company.DoesNotExist error in SupplierBarcodeMixin (#6467) (#6469)

This commit is contained in:
Bobbe 2024-02-12 02:03:18 +01:00 committed by GitHub
parent d7f05cdcb7
commit 43355904b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -225,10 +225,10 @@ class SupplierBarcodeMixin(BarcodeMixin):
return None
if supplier_pk := self.get_setting("SUPPLIER_ID"):
if (supplier := Company.objects.get(pk=supplier_pk)):
return supplier
else:
logger.error(
try:
return Company.objects.get(pk=supplier_pk)
except Company.DoesNotExist:
logger.exception(
"No company with pk %d (set \"SUPPLIER_ID\" setting to a valid value)",
supplier_pk
)