1👍
✅
You did it wrong. request.user
is an object, while name
is a string.
Rewrite your condition as follows:
if request.user.is_authenticated() and request.user.username == name:
Source:stackexchange.com