Flask-WTFform: Flash does not display errors
问题 I'm trying to flash WTForm validation errors. I found this snippet and slightly modified it: def flash_errors(form): """Flashes form errors""" for field, errors in form.errors.items(): for error in errors: flash(u"Error in the %s field - %s" % ( getattr(form, field).label.text, error ), 'error') Here is one of my form classes: class ContactForm(Form): """Contact form""" # pylint: disable=W0232 # pylint: disable=R0903 name = TextField(label="Name", validators=[Length(max=35), Required()])