2👍
✅
{% if user.is_authenticated == category.author %}
is not a valid check. user.is_authenticated
returns a boolean (True
/False
), and category.author
is a user
object. You are checking for equality incorrectly.
Try this instead:
{% if user.is_authenticated and user == category.author %}
since category.author
is a User
instance
Source:stackexchange.com