Skip to content

Commit

Permalink
Fix uncaught Company.DoesNotExist error in SupplierBarcodeMixin (#6467)…
Browse files Browse the repository at this point in the history
… (#6469)
  • Loading branch information
30350n committed Feb 12, 2024
1 parent d7f05cd commit 4335590
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions InvenTree/plugin/base/barcodes/mixins.py
Expand Up @@ -225,10 +225,10 @@ def get_supplier(self) -> Company | None:
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
)
Expand Down

0 comments on commit 4335590

Please sign in to comment.