Skip to content

Commit

Permalink
Bug fix for wire color lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
SchrodingersGat committed Aug 6, 2024
1 parent 468a164 commit ee1cbdb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inventree_wireviz/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,19 @@ def match_part(self, line: dict):

if len(wire_data) >= 3:
color = wire_data[2]

wire_pn = f"{pn}-{color}"
wire_pn = f"{pn}-{color}"
else:
wire_pn = pn

# Match wire_pn -> part.IPN
results = Part.objects.filter(IPN=wire_pn)

if results.count() == 1:
return results.first()

# Match wire_pn -> part.name
results = Part.objects.filter(name=wire_pn)

if results.count() == 1:
return results.first()

Expand Down

0 comments on commit ee1cbdb

Please sign in to comment.