mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix uncaught Company.DoesNotExist error in SupplierBarcodeMixin (#6467)
This commit is contained in:
parent
bf2111ef9d
commit
e6e6473503
@ -224,9 +224,9 @@ class SupplierBarcodeMixin(BarcodeMixin):
|
||||
return None
|
||||
|
||||
if supplier_pk := self.get_setting('SUPPLIER_ID'):
|
||||
if supplier := Company.objects.get(pk=supplier_pk):
|
||||
return supplier
|
||||
else:
|
||||
try:
|
||||
return Company.objects.get(pk=supplier_pk)
|
||||
except Company.DoesNotExist:
|
||||
logger.error(
|
||||
'No company with pk %d (set "SUPPLIER_ID" setting to a valid value)',
|
||||
supplier_pk,
|
||||
|
Loading…
Reference in New Issue
Block a user