def _action(self, serializer):
        self.request.user.set_password(serializer.data['new_password'])
        self.request.user.save()

        if settings.LOGOUT_ON_PASSWORD_CHANGE:
            utils.logout_user(self.request)

        return Response(status=status.HTTP_204_NO_CONTENT)
    def post(self, request, *args, **kwargs):
        instance = self.get_object()
        serializer = self.get_serializer(instance, data=request.data)
        serializer.is_valid(raise_exception=True)

        utils.logout_user(self.request)
        instance.delete()

        return Response(status=status.HTTP_204_NO_CONTENT)
 def perform_destroy(self, instance):
     utils.logout_user(self.request)
     super(UserViewSet, self).perform_destroy(instance)
 def post(self, request):
     utils.logout_user(request)
     return Response(status=status.HTTP_204_NO_CONTENT)