Skip to content

Commit

Permalink
[Element14][Fixed] Problems when no RoHS info found
Browse files Browse the repository at this point in the history
Closes #553
  • Loading branch information
set-soft committed Nov 21, 2023
1 parent 0108e18 commit 8333165
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kicost/distributors/api_element14.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ def _query_part_info(dist, country, parts, distributors, currency):
if part.lifecycle is None:
part.lifecycle = 'obsolete' if data['productStatus'] == 'NO_LONGER_MANUFACTURED' else 'active'
tolerance = footprint = frequency = None
specs = {'rohs': ('RoHS', data['rohsStatusCode'])}
specs = {}
if 'rohsStatusCode' in data:
specs['rohs'] = ('RoHS', data['rohsStatusCode'])
for sp in data.get('attributes', []):
name = sp['attributeLabel']
name_l = name.lower()
Expand Down

0 comments on commit 8333165

Please sign in to comment.