Skip to content

Commit

Permalink
fix timeout when alternate IPN is used
Browse files Browse the repository at this point in the history
  • Loading branch information
T0jan committed Jun 23, 2023
1 parent 322f40f commit 47c45f2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions kintree/database/inventree_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ def get_part_from_ipn(part_ipn='') -> int:
''' Get Part ID from Part IPN '''
global inventree_api

parts = Part.list(inventree_api)

for part in parts:
if part.IPN == part_ipn:
return part

# No part found
return None
parts = Part.list(inventree_api, IPN=part_ipn)

if not parts:
# No part found
return None
else:
# parts should have only one entry
return parts[0]


def fetch_part(part_id='', part_ipn='') -> int:
Expand Down

0 comments on commit 47c45f2

Please sign in to comment.