Bug #45476
API entreprise - normalize_dates TypeError
Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Version cible:
-
Début:
27 juillet 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Non
Planning:
Non
Description
TypeError at /api-entreprise/api-entreprise/associations/<id>/
string indices must be integers
TypeError at /api-entreprise/api-entreprise/associations/<i>/ string indices must be integers Request Method: GET Request URL: https://passerelle.demarches.venissieux.fr/api-entreprise/api-entreprise/associations/<i>/?... Django Version: 1.11.20 Python Executable: /usr/bin/uwsgi-core Python Version: 3.5.3 Python Path: ['.', '', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages'] Server time: lun, 27 Jul 2020 10:23:50 +0200 Installed Applications: '' Installed Middleware: '' Traceback: File "/usr/lib/python3/dist-packages/passerelle/utils/jsonresponse.py" in api 128. resp = f(*args, **kwargs) File "/usr/lib/python3/dist-packages/passerelle/views.py" in perform 470. result = self.endpoint(request, **params) File "/usr/lib/python3/dist-packages/passerelle/apps/api_entreprise/models.py" in associations 282. return self.get('associations/%s/' % association_id, **kwargs) File "/usr/lib/python3/dist-packages/passerelle/apps/api_entreprise/models.py" in get 127. normalize_dates(data) File "/usr/lib/python3/dist-packages/passerelle/apps/api_entreprise/models.py" in normalize_dates 44. normalize_dates(data[key]) File "/usr/lib/python3/dist-packages/passerelle/apps/api_entreprise/models.py" in normalize_dates 44. normalize_dates(data[key]) File "/usr/lib/python3/dist-packages/passerelle/apps/api_entreprise/models.py" in normalize_dates 47. normalize_dates(item) File "/usr/lib/python3/dist-packages/passerelle/apps/api_entreprise/models.py" in normalize_dates 43. if isinstance(data[key], dict): Exception Type: TypeError at /api-entreprise/api-entreprise/associations/38136283900015/ Exception Value: string indices must be integers
On plante sur un payload de la forme:
data {'association': {'adresse_siege': {'code_insee': ['69259', '69259'], 'code_postal': ['69200', '69200'], 'commune': ['xx', 'xx'], 'complement': 'xx', 'distribution': ['xx', 'xx'], 'libelle_voie': ['xx', 'xx'], 'numero_voie': ['xx', 'xx'], 'type_voie': ['AV', 'AV']}, 'civilite_dirigeant': None, 'code_civilite_dirigeant': None, 'code_etat': None, 'code_groupement': None, 'date_creation': None, 'date_declaration': None, 'date_dissolution': None, 'date_publication': None, 'etat': 'true', 'groupement': None, 'id': None, 'mise_a_jour': None, 'objet': None, 'siret': 'xx', 'siret_siege_social': 'xx', 'titre': 'xx'}}
sur:
data '69200' key '6'
Demandes liées
Historique
Mis à jour par Frédéric Péters il y a presque 4 ans
- Duplique Bug #39541: api entreprise, normalisation de date vs listes ajouté