2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 19:46:46 +00:00

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

This commit is contained in:
Bobbe 2024-02-11 21:58:57 +01:00 committed by GitHub
parent bf2111ef9d
commit e6e6473503
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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