Last active
February 25, 2019 16:48
-
-
Save rodrigobertin/d7a7aa23e4685a26445e84ee17bad08f to your computer and use it in GitHub Desktop.
Flask WTF 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
def flash_errors(form): | |
""" | |
Errores de formulario | |
:param form: | |
:return: | |
""" | |
for field, errors in form.errors.items(): | |
for error in errors: | |
flash(u"Error en %s campo - %s" % ( | |
getattr(form, field).label.text, | |
error | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment