I have a condition like this:
{% if object.author == user or object.res_person_1_username == user %}
If I view variables with, for example:
<p class="article-content mb-1"><strong>object.res_person_1_username: </strong>{{ object.res_person_1_username }}</p>
They are the same, all three, but condition
object.res_person_1_username == user
is always False. Why is that? What I'm missing? Do I need to change data type or something?
models.py
res_person_1_username = models.TextField(blank=True, max_length=40)
Userobject.useris normally passed automatically to the template asrequest.user(that is whyrequestis passed in therender(...)call, so this is a comparison between aUserobject and a string.res_person_1_usernamein ur model.py to a Foreignkey and link it to auth User model