Created
July 21, 2014 11:24
-
-
Save richardjpope/5cba4186e991c05c3973 to your computer and use it in GitHub Desktop.
flask form errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if form.errors %} | |
<div class="alert alert-danger"> | |
<ul> | |
{% for field_name, field_errors in form.errors|dictsort if field_errors %} | |
{% for error in field_errors %} | |
<li>{{ form[field_name].label }}: {{ error }}</li> | |
{% endfor %} | |
{% endfor %} | |
</ul> | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment