Reformat establishment elastic location for api
This commit is contained in:
parent
e0d09486c2
commit
fec3a2f6bc
|
|
@ -86,7 +86,12 @@ class EstablishmentDocumentSerializer(DocumentSerializer):
|
|||
if ret.get('address'):
|
||||
ret['address']['city']['country']['name_translated'] = get_translated_value(
|
||||
ret['address']['city']['country'].pop('name'))
|
||||
location = ret['address'].pop('location')
|
||||
if location:
|
||||
ret['address']['geo_lon'] = location['lon']
|
||||
ret['address']['geo_lat'] = location['lat']
|
||||
|
||||
ret['type'] = ret.pop('establishment_type')
|
||||
ret['subtypes'] = ret.pop('establishment_subtypes')
|
||||
|
||||
return ret
|
||||
Loading…
Reference in New Issue
Block a user