middleware.py 文件源码

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

项目:producthunt 作者: davidgengler 项目源码 文件源码
def clean_username(self, username, request):
        """
        Allows the backend to clean the username, if the backend defines a
        clean_username method.
        """
        backend_str = request.session[auth.BACKEND_SESSION_KEY]
        backend = auth.load_backend(backend_str)
        try:
            username = backend.clean_username(username)
        except AttributeError:  # Backend has no clean_username method.
            pass
        return username
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号