views.py 文件源码

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

项目:BackManager 作者: linuxyan 项目源码 文件源码
def upuser(userid):
    if current_user.id == userid or current_user.role == '0':
        form = UserEditForm()
        if form.validate_on_submit():
            user = users.query.filter_by(id=userid).first()
            if user is not None and user.verify_password(form.oldpassword.data):
                user.password = form.password.data
                db.session.add(user)
                db.session.commit()
                flash(u'??????!')
                return render_template('useredit.html',form=form)

        user = users.query.filter_by(id=userid).first()
        form.username.data = user.username
        form.name.data = user.name
        return render_template('useredit.html',form=form)
    else:
        abort(403)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号