summaryrefslogtreecommitdiffstats
path: root/public/templatetags/validation.py
blob: 40c48da98ade101544f00ab32883397685eedf50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
from django import template

register = template.Library()

@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}