我试图is_authenticated()在视图中使用,但得到错误`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'))
Run Code Online (Sandbox Code Playgroud)