summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2018-11-04 08:41:41 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2018-11-04 08:41:41 (GMT)
commit29b9cba7385d6efdc1d851766f64c4ed0012a3d4 (patch)
treeaaac160383861f9ff275cf2117a8c84e1eed84f1
parent7847bbf569c80804bb589c041f04a8760ff88008 (diff)
downloadpasserelle-grandlyon-cartads-29b9cba7385d6efdc1d851766f64c4ed0012a3d4.zip
passerelle-grandlyon-cartads-29b9cba7385d6efdc1d851766f64c4ed0012a3d4.tar.gz
passerelle-grandlyon-cartads-29b9cba7385d6efdc1d851766f64c4ed0012a3d4.tar.bz2
don't crash on cartads responses missing DossierEtape entry
-rw-r--r--cartads/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cartads/models.py b/cartads/models.py
index 7bec33e..ec4b1e8 100644
--- a/cartads/models.py
+++ b/cartads/models.py
@@ -407,7 +407,7 @@ class CartADS(BaseResource):
# On parcourt la liste a partir de la fin pour chercher le bon dossier
idDossierOut = ''
nomDossierOut = ''
- for objet in sorted(dict_resp['DossierEtape'], key=getOrder):
+ for objet in sorted(dict_resp.get('DossierEtape', []), key=getOrder):
resp_dossier = self.get_client('cartads-dossier.wsdl').service.GetInfosDossier(self.get_token_cartads(), objet["IdDossier"])
dict_resp_dossier = sudsobject_to_dict(resp_dossier)
if dict_resp_dossier["IdDossierExterne"] == tracking_code: