Django request.user.is authenticated() TypeError: 'bool' object is not callable

Опубликовано: 18 Май 2019
на канале: Jarad Python
5,236
102

If you're getting a TypeError: 'bool' object is not callable when attempting request.user.is_authenticated(), the reason is that you need to remove the parentheses from is_authenticated().

The hint is the word "callable" in the error message. If something isn't callable, that usually means just remove the parentheses so you're not calling the function.

is_authenticated is an attribute and it's read-only.

Helpful Links
https://docs.djangoproject.com/en/2.2...