is_authenticated() raises TypeError TypeError: 'bool' object is not callable [duplicate] is_authenticated() raises TypeError TypeError: 'bool' object is not callable [duplicate] flask flask

is_authenticated() raises TypeError TypeError: 'bool' object is not callable [duplicate]


"object is not callable" error occurs when you are trying to behave an object like it is a method or function.

in this case:

current_user.is_authenticated()

you are behaveing current_user.is_authenticated as a method but its not a method .

you have to use it in this way :

current_user.is_authenticated

you use "( )" after methods or functions, not objects.

In some cases a class might implement __call__ function which you can call an object too, then it will be callable.


From Flask-Login 0.3.0 (released on September 10th, 2015) changes:

  • BREAKING: The is_authenticated, is_active, and is_anonymous members of the user class are now properties, not methods. Applications should update their user classes accordingly.

So you need to change your user class and code accordingly.