blob: 11e2bb230e4d1f235e112d8171e767eb54f7f3bf (
plain)
1
2
3
4
5
6
7
8
9
|
from flask import flash
def flash_errors(form):
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
), 'danger')
|