msg.py 文件源码

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

项目:msg 作者: lily-mayfield 项目源码 文件源码
def get_password(username, password):
    """For HTTPBasicAuth; this simply gets the
    corresponding user, then return the result
    of checking that password.

    Arguments:
        username (str):
        password (str):

    See Also:
        flask_httpauth

    Returns:
        bool: True if the password is correct for the supplied
            username, False otherwise.

    """

    result = (db.session.query(models.User)
              .filter(models.User.username == username).first())

    if result is None:
        return False
    else:
        return result.check_password(password)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号