is_active
, is_anonymous
, and is_authenticated
are all properties as of Flask-Login 0.3. If you want to use them, treat them as attributes, don’t call them. If you want to override them, remember to decorate them with @property
.
# change from
current_user.is_authenticated()
# to
current_user.is_authenticated
It appears you are reading the docs for the most recent version (0.3), but using an older version of the library. Version 0.3 contains a breaking change which changed these attributes from methods to properties. You should upgrade to the latest version of Flask-Login and treat them as properties.
You deactivate the user by causing its is_active
property to return False
. Your idea to return the value of a column is fine.