Skip to content

Commit

Permalink
Merge pull request #43 from inventree/wire-color-fix
Browse files Browse the repository at this point in the history
Wire color fix
  • Loading branch information
SchrodingersGat authored Aug 6, 2024
2 parents 468a164 + aa90e2f commit f10d9a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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
2 changes: 1 addition & 1 deletion inventree_wireviz/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Version information for the inventree-wireviz plugin"""

PLUGIN_VERSION = "0.6.1"
PLUGIN_VERSION = "0.6.2"

0 comments on commit f10d9a8

Please sign in to comment.