suivi: fix error handling of fedex parcel
This commit is contained in:
parent
29817ba1c1
commit
281d81acc4
@ -156,7 +156,9 @@ def get_fedex_info(fedex_id, lang="en_US"):
|
||||
|
||||
if ("TrackPackagesResponse" in fedex_data and
|
||||
"packageList" in fedex_data["TrackPackagesResponse"] and
|
||||
len(fedex_data["TrackPackagesResponse"]["packageList"])
|
||||
len(fedex_data["TrackPackagesResponse"]["packageList"]) and
|
||||
not fedex_data["TrackPackagesResponse"]["errorList"][0]["code"] and
|
||||
not fedex_data["TrackPackagesResponse"]["packageList"][0]["errorList"][0]["code"]
|
||||
):
|
||||
return fedex_data["TrackPackagesResponse"]["packageList"][0]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user