Example #1
0
    def _to_httpresponse(self, data):

        if '@context' not in data:
            data['@context'] = ATSIGN_CONTEXT

        result = JsonResponse(
                data=data,
                json_dumps_params={
                    'sort_keys': True,
                    'indent': 2,
                    }
                )

        result['Content-Type'] = 'application/activity+json; charset=utf-8'

        if 'former_type' in data:
            result.reason = 'Entombed'
            result.status_code = 410

        return result