Fix structured data when individual object is viewed.
Example link that crashes: https://db.satnogs.org/api/satellites/43111/?format=json-ld
The problem is that for loop (for satellite in data:
) loops over the dictionary keys of data, which in this individual object view, is not an array of dictionaries, like in multiple objects view, but a dictionary/
Sentry Issue: SATNOGS-DB-9D
TypeError: string indices must be integers
(6 additional frame(s) were not displayed)
...
File "rest_framework/renderers.py", line 680, in get_context
'content': self.get_content(renderer, data, accepted_media_type, renderer_context),
File "rest_framework/renderers.py", line 413, in get_content
content = renderer.render(data, accepted_media_type, renderer_context)
File "db/api/renderers.py", line 18, in render
structured_data = get_structured_data(renderer_context['view'].basename, data)
File "db/base/structured_data.py", line 237, in get_structured_data
return SatelliteStructuredData(data)
File "db/base/structured_data.py", line 75, in __init__
"@id": satellite_id_domain + str(satellite['norad_cat_id']),