From 8572cccf9f9e0fb4c3dc5a8ed7ff421c4fb2bb70 Mon Sep 17 00:00:00 2001 From: Andreas Mieke Date: Sat, 20 Apr 2024 22:06:09 -0400 Subject: [PATCH] fix(label): Check if attributes exist --- inventree_phomemo/phomemo_label.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inventree_phomemo/phomemo_label.py b/inventree_phomemo/phomemo_label.py index 73133fe..8176aab 100644 --- a/inventree_phomemo/phomemo_label.py +++ b/inventree_phomemo/phomemo_label.py @@ -65,9 +65,9 @@ class PhomemoLabelPlugin(LabelPrintingMixin, SettingsMixin, InvenTreePlugin): 'name': tpart.name, 'description': tpart.description, 'pk': tpart.pk, - 'params': tpart.parameters_map(), - 'category': tpart.category.name, - 'category_path': tpart.category.pathstring, + 'params': tpart.parameters_map() if hasattr(tpart, 'parameters_map') else None, + 'category': tpart.category.name if hasattr(tpart, 'category') else None, + 'category_path': tpart.category.pathstring if hasattr(tpart, 'category') else None, 'barcode': barcode, 'type': kwargs['label_instance'].SUBDIR }