def create_state_response(record):
    """Create the state response body from a record."""
    return {'job_id': record.job_id, 'state': record.state, 'task': record.
        task, 'task_percent': str(record.task_percent), 'complete': bool(
        record.complete), 'updated': str(record.updated), 'created': str(
        record.created), 'exception': str(record.exception)}
