title: Conditionally join a list of strings in Jinja
body: <p>I have a list like</p>
  
  <pre><code>users = ['tom', 'dick', 'harry']
  </code></pre>
  
  <p>In a <code>Jinja</code> template I'd like to print a list of all users except <code>tom</code> joined. I cannot modify the variable before it's passed to the template.</p>
  
  <p>I tried a list comprehension, and using Jinja's <code>reject</code> filter but I haven't been able to get these to work, e.g. </p>
  
  <pre><code>{{ [name for name in users if name != 'tom'] | join(', ') }}
  </code></pre>
  
  <p>gives a syntax error.</p>
  
  <p>How can I join list items conditionally?</p>