title: python ternary in jinja2 gives TemplateSyntaxError: tag name expected
body: <p>I have a table and I want to change background color of tr if value of person.storyPublished is true otherwise do nothing. </p>
  
  <p>My code looks like this: </p>
  
  <pre><code> {% for person in people %}
      &lt;tr class="row-person {% '.row-story-published' if  person.storyPublished  else ' ' %}" &gt;
      &lt;td&gt;
      {{ person.name }}
      &lt;/td&gt;
      ...
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>jinja2.exceptions.TemplateSyntaxError
  TemplateSyntaxError: tag name expected
  </code></pre>
  
  <p>and the CSS part is here:</p>
  
  <pre><code>&lt;style&gt;
      .row-story-published{
          background-color: #b3ffb3;
      }
  &lt;/style&gt;
  </code></pre>
  
  <p>why is this happening? What i miss that I don't notice? Any help :)</p>