py3: convert dictvalues() to list before indexing (2nd, #45149)

This commit is contained in:
Frédéric Péters 2020-07-15 20:14:10 +02:00
parent efd1462213
commit 9acdf65d3b
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class CountryWidget(forms.Select):
if getattr(settings, 'IMIO_COUNTRY_URL', None):
country_url = settings.IMIO_COUNTRY_URL
else:
passerelle_url = list(settings.KNOWN_SERVICES['passerelle'].values()[0])['url']
passerelle_url = list(settings.KNOWN_SERVICES['passerelle'].values())[0]['url']
country_url = '%s/csvdatasource/pays/data' % passerelle_url
try:
self.choices = [(x['id'], x['text']) for x in requests.get(country_url).json()['data']]