Created
February 22, 2018 12:18
-
-
Save taiypeo/3f8da6bede34c93be947845804646eaf to your computer and use it in GitHub Desktop.
A Jinja2 macro that prints all of the errors of a WTForms field
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
{% macro print_errors(field) -%} | |
{% for err in field.errors %} | |
<span style="color: red;">[{{ err }}]</span> | |
{% endfor %} | |
{%- endmacro %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment