"object not callable" error occurs when you try to behave like an object, such as a method or function.
in this case:
current_user.is_authenticated()
you are running current_user.is_authenticated as a method, but it is not a method.
you should use it as follows:
current_user.is_authenticated
you use "()" after methods or functions, not objects.
In some cases, the class may implement the __call__ function, which you can also call the object, then it will be called.
Sepehr hamzelooy
source share