I got stuck in my coding project in jinja templates.
I want to show posts of a user just if 2 conditions are met:
The problematic part is if using and
, conditions work perfectly individually but the moment I add and
and join them together it does not work.
I have tried it with brackets and without them.
{% for post in posts %}
{% if (session['user']['username']==post['author']) and (post["id"] | is_liked) %}
{% else %}
<li class="row">
{% include "components/recommended.html" %}
</li>
{% endif %}
{% endfor %}
Could you please help me how to write that line, so that both conditions are checked?
{% if 1 == 1 and 3 ==2 %} this works {% else %} this doesn't work {% endif %}
and it gave expected output, I would encourage you to check your condition