The payload starts life as an Incident or Event object,
rendered to a JSON string, then stored as a text field.
To enable the JSON renderer in Django Rest Framework to
render this as an object rather than a JSON-encoded string
the easiest option is to deserialize the field prior to
sending it to the renderer.
An alternative would be to override the from_db method on
the Event model, but since we don't need to modify the payload
anywhere, it's simpler to do this in the serializer.
The payload starts life as an Incident or Event object, rendered to a JSON string, then stored as a text field.
To enable the JSON renderer in Django Rest Framework to render this as an object rather than a JSON-encoded string the easiest option is to deserialize the field prior to sending it to the renderer.
An alternative would be to override the from_db method on the Event model, but since we don't need to modify the payload anywhere, it's simpler to do this in the serializer.