Skip to content

Commit

Permalink
fix(allied_express_local): shipment cancellation response parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
danh91 committed Feb 23, 2024
1 parent 535de06 commit a8e1328
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@ def parse_error_response(
errors.append(
[
"400",
response.data["result"].get("statusError")
or response.data["result"].get("errors"),
(
(
response.data["result"].get("statusError")
or response.data["result"].get("errors")
)
if isinstance(response.data["result"], dict)
else response.data["result"]
),
]
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def parse_shipment_cancel_response(
) -> typing.Tuple[models.ConfirmationDetails, typing.List[models.Message]]:
response = _response.deserialize()
messages = error.parse_error_response(response, settings)
success = not response.is_error and (response.data.get("result")) == "0"
success = not response.is_error # and (response.data.get("result")) == "0"

confirmation = (
models.ConfirmationDetails(
Expand Down

0 comments on commit a8e1328

Please sign in to comment.