title: Jinja2 If ignores boolean value
body: <p>I have a Jinja2 template where a variable that resolves as a boolean False is being ignored in an <code>{% if %}</code> statement.</p>
  <p>The relevant chunk of the template looks like</p>
  <pre><code>{% if user.can_manage_techniques %}j
  {% block submenu_items %}
  &lt;li class=&quot;pure-menu-item&quot;&gt;&lt;a href={{ url_for('new_technique') }} class=&quot;pure-menu-link&quot;&gt;New Technique&lt;/a&gt;&lt;/li&gt;
  {% endblock %}
  {% endif %}
  </code></pre>
  <p>The user is set in render template as</p>
  <pre class="lang-py prettyprint-override"><code>    return render_template('technique_list.j2',
                              techniques=Technique.find_all(),
                              **state())
  </code></pre>
  <p>with the state being a function that returns a dict[string, object].</p>
  <p>The user that is passed to it is set in the <code>__init__</code> of the object as a variable - so:</p>
  <pre class="lang-py prettyprint-override"><code>    def __init__(self):
          self.can_manage_techniques = False
  </code></pre>
  <p><strong>Even when the <code>can_manage_techniques</code> is false, the list item still renders</strong>. How do I make the <code>{% if %}</code> realise that it is false and go to the <code>{% endif %}</code>?</p>
  <p>I have also tried <code>== true</code> and <code>sameas true</code></p>