Skip to content

Instantly share code, notes, and snippets.

@cantoniazzi
Created April 11, 2018 00:05
Show Gist options
  • Save cantoniazzi/298643fb804a9639164e150a79d1e10c to your computer and use it in GitHub Desktop.
Save cantoniazzi/298643fb804a9639164e150a79d1e10c to your computer and use it in GitHub Desktop.
A gist that displays in the template a form of global iteration of form validation errors in a flask application.
{% if form.errors %}
{% for field in form.errors %}
{% for error in form.errors[field] %}
<div class="alert alert-danger">
<small class="text-danger">
<strong>Error:</strong> {{ error }}
</small>
</div>
{% endfor %}
{% endfor %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment