mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 11:27:09 +00:00
refactor: prep for fallback to organisation latlng
This commit is contained in:
@@ -106,15 +106,21 @@ def get_map_data(person: models.Person) -> typing.Dict[str, typing.Any]:
|
||||
try:
|
||||
latitude = answer_set.latitude or None
|
||||
longitude = answer_set.longitude or None
|
||||
organisation = answer_set.organisation.name or None
|
||||
country = answer_set.country_of_residence.name or None
|
||||
|
||||
except AttributeError:
|
||||
latitude = None
|
||||
longitude = None
|
||||
organisation = None
|
||||
country = None
|
||||
|
||||
return {
|
||||
'name': person.name,
|
||||
'lat': latitude,
|
||||
'lng': longitude,
|
||||
'organisation': organisation,
|
||||
'country': country,
|
||||
'url': reverse('people:person.detail', kwargs={'pk': person.pk})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user