Skip to content

Commit

Permalink
Merge pull request #236 from T0jan/LCSC_fix
Browse files Browse the repository at this point in the history
Lcsc fixes
  • Loading branch information
eeintech authored Jun 14, 2024
2 parents 9a666a2 + b8f9d11 commit 321ca37
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions kintree/gui/views/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions kintree/search/lcsc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'] = {}
Expand Down

0 comments on commit 321ca37

Please sign in to comment.