Bug #33506
cart@ds : ne pas planter sur un type de dossier sans "objet de la demande" associé
Début:
28 mai 2019
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
File "/usr/lib/python2.7/dist-packages/passerelle/utils/jsonresponse.py" in api 147. resp = f(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/passerelle/views.py" in perform 421. result = self.endpoint(request, **params) File "/usr/lib/python2.7/dist-packages/passerelle/apps/cartads_cs/models.py" in objets_demande 161. return {'data': [{'id': str(x['Key']), 'text': x['Value']} for x in resp]} Exception Type: TypeError at /cartads-cs/cartds/objets_demande Exception Value: 'NoneType' object is not iterable
Fichiers
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a presque 5 ans
- Fichier 0001-cartads-don-t-crash-on-dossier-types-without-any-sub.patch 0001-cartads-don-t-crash-on-dossier-types-without-any-sub.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Thomas Noël il y a presque 5 ans
- Statut changé de Solution proposée à Solution validée
ack même si personnellement j'aurai écrit
resp = ... if not resp: return {'data': []} return ...
parce que les "or die" j'ai toujours eu du mal
Mis à jour par Frédéric Péters il y a presque 5 ans
- Statut changé de Solution validée à Résolu (à déployer)
J'ai failli (mais il y avait déjà un "or []" dans un des autres endpoints.
commit 1be5d77be9926d616242aa0f5ab77256ea7a6097 Author: Frédéric Péters <fpeters@entrouvert.com> Date: Tue May 28 15:54:42 2019 +0200 cartads: don't crash on dossier types without any subjects (#33506)
Mis à jour par Frédéric Péters il y a presque 5 ans
- Statut changé de Résolu (à déployer) à Solution déployée
cartads: don't crash on dossier types without any subjects (#33506)