- Add the UTF-8 marker to files without it. - Fix some hanging indents. - Change ''' into """ in docstrings. - Enforce two blank line rule.master
parent
73480f4df4
commit
2a45b9f4ba
@ -1,4 +1,4 @@ |
|||||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||||
'''The public module, including the homepage and user auth.''' |
"""The public module, including the homepage and user auth.""" |
||||||
|
|
||||||
from . import views |
from . import views |
||||||
|
@ -1,3 +1,3 @@ |
|||||||
'''The user module.''' |
# -*- coding: utf-8 -*- |
||||||
|
"""The user module.""" |
||||||
from . import views |
from . import views |
||||||
|
@ -1,10 +1,11 @@ |
|||||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||||
'''Helper utilities and decorators.''' |
"""Helper utilities and decorators.""" |
||||||
from flask import flash |
from flask import flash |
||||||
|
|
||||||
|
|
||||||
def flash_errors(form, category="warning"): |
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 field, errors in form.errors.items(): |
||||||
for error in errors: |
for error in errors: |
||||||
flash("{0} - {1}" |
flash("{0} - {1}" |
||||||
.format(getattr(form, field).label.text, error), category) |
.format(getattr(form, field).label.text, error), category) |
||||||
|
Loading…
Reference in new issue