Skip to content

Commit

Permalink
amend function
Browse files Browse the repository at this point in the history
  • Loading branch information
markj0hnst0n committed Jul 3, 2024
1 parent d619c0e commit 4a49311
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mail/libraries/lite_to_edifact_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ def generate_lines_for_licence(licence: LicencePayload) -> Iterable[chieftypes._
controlled_by = "Q" # usage is controlled by quantity only
quantity = commodity.get("quantity")

try:
qunit = UnitMapping[commodity["unit"]]
except KeyError:
if commodity["unit"] in LegacyUnitCodeMapping:
qunit = LegacyUnitCodeMapping[commodity["unit"]]

else:
qunit = UnitMapping[commodity["unit"]]

if qunit == UnitMapping.NAR:
quantity = int(quantity)
yield chieftypes.LicenceDataLine(
Expand Down

0 comments on commit 4a49311

Please sign in to comment.