[suivi] Fix Fedex tracking

This commit is contained in:
Max 2017-09-26 02:25:14 +02:00 committed by Pierre-Olivier Mercier
parent c23dc22ce2
commit a7f4ccc959

View File

@ -176,7 +176,8 @@ def get_fedex_info(fedex_id, lang="en_US"):
if ("TrackPackagesResponse" in fedex_data and if ("TrackPackagesResponse" in fedex_data and
"packageList" in fedex_data["TrackPackagesResponse"] and "packageList" in fedex_data["TrackPackagesResponse"] and
len(fedex_data["TrackPackagesResponse"]["packageList"]) and len(fedex_data["TrackPackagesResponse"]["packageList"]) and
not fedex_data["TrackPackagesResponse"]["errorList"][0]["code"] and (not fedex_data["TrackPackagesResponse"]["errorList"][0]["code"] or
fedex_data["TrackPackagesResponse"]["errorList"][0]["code"] == '0') and
not fedex_data["TrackPackagesResponse"]["packageList"][0]["errorList"][0]["code"] not fedex_data["TrackPackagesResponse"]["packageList"][0]["errorList"][0]["code"]
): ):
return fedex_data["TrackPackagesResponse"]["packageList"][0] return fedex_data["TrackPackagesResponse"]["packageList"][0]