我试图在视图中使用is_authenticated()
,但得到错误'TypeError:'bool'对象不可调用。为什么我得到这个错误,我该如何解决?is_authenticated()引发TypeError TypeError:'bool'对象不可调用
@auth.before_app_request
def before_request():
if current_user.is_authenticated() \
and not current_user.confirmed \
and request.endpoint[:5] != 'auth.' \
and request.endpoint != 'static':
return redirect(url_for('auth.unconfirmed'))
删除括号 – hsfzxjy
删除'()'。 –
感谢您的帮助! – Gaoyang