How to output a comma delimited list in jinja python template?
You want your if
check to be:
{% if not loop.last %}
,
{% endif %}
Note that you can also shorten the code by using If Expression:
{{ ", " if not loop.last else "" }}
You could also use the builtin join
filter like this:
{{ users|join(', ') }}