fix discojuice geo strange format
geo can be a list of dict, or a dict.
This commit is contained in:
parent
19495535ab
commit
baba3c00e0
|
@ -66,8 +66,11 @@ n = 0
|
|||
idps = []
|
||||
for provider in LibertyProvider.objects.all():
|
||||
n += 1
|
||||
geo = geo_idps.get(provider.entity_id, {}).get('geo',
|
||||
{'lat': 47.0+2.0*math.sin(n), 'lon': 2.5+3.0*math.cos(n)})
|
||||
geo = geo_idps.get(provider.entity_id, {}).get('geo')
|
||||
if isinstance(geo, list) and geo:
|
||||
geo = geo[0]
|
||||
if not geo:
|
||||
geo = {'lat': 47.0+2.0*math.sin(n), 'lon': 2.5+3.0*math.cos(n)}
|
||||
idps.append({
|
||||
'entityid': provider.entity_id,
|
||||
'name': get_ui_displayname(provider),
|
||||
|
|
Reference in New Issue