美文网首页
ERROR集合

ERROR集合

作者: FirmStone | 来源:发表于2018-07-15 08:47 被阅读0次

'bool' object is not callable

@app.route('/login', methods=['GET', 'POST'])
@oid.loginhandler
def login():
    # 认证用户
    if g.user is not None and g.user.is_authenticated():
        return redirect(url_for('index'))
    form = LoginForm()
    if form.validate_on_submit():
        session['remember_me'] = form.remember_me.data
        # The ask_for and ask_for_optional`parameter can be a set of values to be asked from the openid provider
        return oid.try_login(form.openid.data, ask_for=['nickname', 'email'])
    return render_template('login.html', title='Sign In', form=form, )

Just use it as a predicate, instead of calling it.布尔类型不能被调用,直接作为判定就行
if g.user is not None and g.user.is_authenticated(): 此行代码修改为if g.user is not None and g.user.is_authenticated:

相关文章

网友评论

      本文标题:ERROR集合

      本文链接:https://www.haomeiwen.com/subject/fnnupftx.html