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

Commit

Permalink
Fix OrderChangeRequest model type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Claven committed Jan 5, 2022
1 parent efb6f2d commit 1091597
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions duffel_api/models/order_change_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ class OrderChangeRequest:

def __init__(self, json):
for key in json:
value = maybe_parse_date_entries(key, json[key])
value = json[key]

if isinstance(value, str):
value = maybe_parse_date_entries(key, json[key])
setattr(self, key, value)
continue

if isinstance(value, list):
if key == "order_change_offers":
value = [OrderChangeOffer(v) for v in value]
elif key == "slices":
value = OrderChangeRequestSlice(value)

if key == "order_change_offers":
value = [OrderChangeOffer(v) for v in value]
elif key == "slices":
value = OrderChangeRequestSlice(value)
setattr(self, key, value)


Expand Down

0 comments on commit 1091597

Please sign in to comment.