class DivErrorList ErrorList def __unicode__ self return join for in s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
class DivErrorList(ErrorList):
def __unicode__(self):
return ''.join([u'%s' % e for e in self])
def register(request):
if request.method == 'POST':
form = RegistrationForm(request.POST,error_class=DivErrorList)
if form.is_valid():
return HttpResponseRedirect('/profile/')
else:
return render_to_response('registration/registration.html',{'form':form})
else:
form = RegistrationForm(auto_id=True,error_class=DivErrorList)
return render_to_response('registration/registration.html',{'form':form})