- It's a method, not a property.
- You need to call it:
if u.is_authenticated():
- Of course, in a template, Django calls methods for you automatically.
is_authenticated
is a method, so you need some parentheses there.
- Otherwise,
u.is_authenticated
is the function object, which is aTrue
value.
- In the template language, functions with no arguments are evaluated as functions, so that's why you're good there.
No comments:
Post a Comment