Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Correct OrderChangeOffer model
Browse files Browse the repository at this point in the history
The `add` and `remove` fields are lists.
  • Loading branch information
Jesse Claven committed Dec 16, 2021
1 parent 32e895b commit 0f24de5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions duffel_api/models/order_change_offer.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ class OrderChangeOfferSlices:
"""The slices to be added and/or removed"""

def __init__(self, json):
setattr(self, "add", OrderChangeOfferSlicesAdd(json["add"]))
setattr(self, "remove", OrderChangeOfferSlicesRemove(json["remove"]))
add = list(map(lambda add: OrderChangeOfferSlicesAdd(add), json["add"]))
remove = list(
map(lambda remove: OrderChangeOfferSlicesRemove(remove), json["remove"])
)

setattr(self, "add", add)
setattr(self, "remove", remove)


class OrderChangeOfferSlicesAdd:
Expand Down

0 comments on commit 0f24de5

Please sign in to comment.