commit
1133aaaba7
@ -1,4 +1,4 @@ |
||||
# -*- coding: utf-8 -*- |
||||
'''The public module, including the homepage and user auth.''' |
||||
"""The public module, including the homepage and user auth.""" |
||||
|
||||
from . import views |
||||
|
@ -1,3 +1,3 @@ |
||||
'''The user module.''' |
||||
|
||||
# -*- coding: utf-8 -*- |
||||
"""The user module.""" |
||||
from . import views |
||||
|
@ -1,10 +1,11 @@ |
||||
# -*- coding: utf-8 -*- |
||||
'''Helper utilities and decorators.''' |
||||
"""Helper utilities and decorators.""" |
||||
from flask import flash |
||||
|
||||
|
||||
def flash_errors(form, category="warning"): |
||||
'''Flash all errors for a form.''' |
||||
"""Flash all errors for a form.""" |
||||
for field, errors in form.errors.items(): |
||||
for error in errors: |
||||
flash("{0} - {1}" |
||||
.format(getattr(form, field).label.text, error), category) |
||||
.format(getattr(form, field).label.text, error), category) |
||||
|
Loading…
Reference in new issue