@decorators.detail_route(methods=['post'])
    def acknowledge(self, request, *args, **kwargs):
        alert = self.get_object()
        if not alert.acknowledged:
            alert.acknowledge()
            return response.Response(status=status.HTTP_200_OK)
        else:
            return response.Response({'detail': 'Alert is already acknowledged'}, status=status.HTTP_409_CONFLICT)
Thanks to the magic of closures, this means we gracefully return JSON
dataset/ETHPy150Open opennode/nodeconductor/nodeconductor/logging/views.py/AlertViewSet.acknowledge--crossover with--dataset/ETHPy150Open striglia/pyramid_swagger/pyramid_swagger/api.py/build_swagger_12_api_declaration_view