cartads: don't crash on dossier types without any subjects (#33506)

This commit is contained in:
Frédéric Péters 2019-05-28 15:54:42 +02:00
parent 370fb9f437
commit 1be5d77be9
1 changed files with 1 additions and 1 deletions

View File

@ -158,7 +158,7 @@ class AbstractCartaDSCS(BaseResource):
def objets_demande(self, request, type_dossier_id):
client = self.soap_client()
resp = client.service.GetObjetsDemande(self.get_token(), type_dossier_id)
return {'data': [{'id': str(x['Key']), 'text': x['Value']} for x in resp]}
return {'data': [{'id': str(x['Key']), 'text': x['Value']} for x in resp or []]}
@endpoint(description=_('Get list of CERFA documents'),
parameters={