Skip to content

Commit

Permalink
Merge pull request #17 from inventree/conversion-fix
Browse files Browse the repository at this point in the history
Fix for unit conversion
  • Loading branch information
SchrodingersGat authored May 26, 2023
2 parents c91e2b3 + 94bdbc9 commit b0b4472
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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.3.0"
PLUGIN_VERSION = "0.3.1"
5 changes: 5 additions & 0 deletions inventree_wireviz/wireviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,11 @@ def convert_quantity(self, quantity, unit, base_unit):
The converted quantity, or the original quantity if conversion failed
"""

# Ignore unit if quantity not given
# Will be specified in the part units anyway
if not unit:
return quantity

logger.debug(f"WirevizPlugin: Converting quantity {quantity} {unit} to {base_unit}")

q = f"{quantity} {unit}"
Expand Down

0 comments on commit b0b4472

Please sign in to comment.