controllers.py 文件源码

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

项目:IntegraTI-API 作者: discentes-imd 项目源码 文件源码
def put(self):
        """Change the password"""
        us = User.query \
            .filter(User.disabled == 0) \
            .filter(User.id_user == g.current_user) \
            .first()
        abort_if_none(us, 404, 'User not found')

        if not check_password_hash(us.password, request.json['old_password']):
            return msg('Old password incorrect'), 403

        us.password = request.json['password']
        db.session.commit()
        cache.blacklisted_tokens.append(request.headers['Authorization'])

        return msg('success!')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号