diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/templatetags/package_extras.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/templatetags/package_extras.py b/packages/templatetags/package_extras.py index 5469f297..5a92565c 100644 --- a/packages/templatetags/package_extras.py +++ b/packages/templatetags/package_extras.py @@ -30,5 +30,14 @@ def do_buildsortqs(parser, token): def space2br(value): return value.replace(' ', '<br />') +@register.inclusion_tag('errors.html') +def print_errors(errors): + errs = [] + for e,msg in errors.iteritems(): + errmsg = str(msg[0]) + # hack -- I'm a python idiot + errs.append( (e, errmsg[2:-2]) ) + return {'errors': errs} + # vim: set ts=4 sw=4 et: |