Skip to content

Instantly share code, notes, and snippets.

@rodrigobertin
Last active February 25, 2019 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodrigobertin/d7a7aa23e4685a26445e84ee17bad08f to your computer and use it in GitHub Desktop.
Save rodrigobertin/d7a7aa23e4685a26445e84ee17bad08f to your computer and use it in GitHub Desktop.
Flask WTF errors
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