resources.py 文件源码

python
阅读 80 收藏 0 点赞 0 评论 0

项目:mes 作者: osess 项目源码 文件源码
def is_authenticated(self, request):
        """
        Handles checking if the user is authenticated and dealing with
        unauthenticated users.

        Mostly a hook, this uses class assigned to ``authentication`` from
        ``Resource._meta``.
        """
        # Authenticate the request as needed.
        auth_result = self._meta.authentication.is_authenticated(request)

        if isinstance(auth_result, HttpResponse):
            raise ImmediateHttpResponse(response=auth_result)

        if not auth_result is True:
            raise ImmediateHttpResponse(response=http.HttpUnauthorized())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号