From c2157831774fb6410664e689d9389597bf248c36 Mon Sep 17 00:00:00 2001 From: T0jan Date: Wed, 12 Jun 2024 17:06:28 +0200 Subject: [PATCH 1/3] fix cases were LCSC doesn't return any parameter or an empty parameter list --- kintree/search/lcsc_api.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kintree/search/lcsc_api.py b/kintree/search/lcsc_api.py index b5c314ad..f0e06bd5 100644 --- a/kintree/search/lcsc_api.py +++ b/kintree/search/lcsc_api.py @@ -95,15 +95,12 @@ def search_timeout(timeout=10): part_info['parameters'] = {} [parameter_key, name_key, value_key] = PARAMETERS_MAP - try: + if part.get(parameter_key, ''): for parameter in range(len(part[parameter_key])): parameter_name = part[parameter_key][parameter][name_key] parameter_value = part[parameter_key][parameter][value_key] # Append to parameters dictionary part_info['parameters'][parameter_name] = parameter_value - except TypeError: - # Parameter list is empty - pass # Pricing part_info['pricing'] = {} From 6894a9436fe74235cd4b94052aafe47f68b2c887 Mon Sep 17 00:00:00 2001 From: T0jan Date: Wed, 12 Jun 2024 17:45:07 +0200 Subject: [PATCH 2/3] add error message for too long part names --- kintree/gui/views/main.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kintree/gui/views/main.py b/kintree/gui/views/main.py index b05b8b99..2059a363 100644 --- a/kintree/gui/views/main.py +++ b/kintree/gui/views/main.py @@ -1406,6 +1406,9 @@ def create_part(self, e=None): if not data_from_views['Part Search'].get('name', None): self.show_dialog(DialogType.ERROR, 'Missing Part Name') return + if len(data_from_views['Part Search'].get('name', None)) > 100: + self.show_dialog(DialogType.ERROR, 'Part Name too long (>100 characters)') + return if not data_from_views['Part Search'].get('description', None): self.show_dialog(DialogType.ERROR, 'Missing Part Description') return From b8f9d111d7d1264b72020124998798cedb28d1e2 Mon Sep 17 00:00:00 2001 From: T0jan <22519396+T0jan@users.noreply.github.com> Date: Fri, 14 Jun 2024 01:22:18 +0200 Subject: [PATCH 3/3] try inventree for test_deploy.yaml --- .github/workflows/test_deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_deploy.yaml b/.github/workflows/test_deploy.yaml index a35474d7..8f4de210 100644 --- a/.github/workflows/test_deploy.yaml +++ b/.github/workflows/test_deploy.yaml @@ -75,7 +75,7 @@ jobs: git clone https://github.com/inventree/InvenTree/ mkdir InvenTree/static cp tests/files/inventree_default_db.sqlite3 InvenTree/ - cd InvenTree/ && git switch 0.14.x && invoke install && invoke migrate && cd - + cd InvenTree/ && git switch stable && invoke install && invoke migrate && cd - - name: Ki-nTree setup run: | invoke install