twice without reason. Also make sure that if field specific clean functions fail, the form-wide field cleaning is removed from cleaned_data. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5346 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
dfdf7bdc5e
commit
198127a0f2
|
@ -188,9 +188,11 @@ class BaseForm(StrAndUnicode):
|
||||||
self.cleaned_data[name] = value
|
self.cleaned_data[name] = value
|
||||||
if hasattr(self, 'clean_%s' % name):
|
if hasattr(self, 'clean_%s' % name):
|
||||||
value = getattr(self, 'clean_%s' % name)()
|
value = getattr(self, 'clean_%s' % name)()
|
||||||
self.cleaned_data[name] = value
|
self.cleaned_data[name] = value
|
||||||
except ValidationError, e:
|
except ValidationError, e:
|
||||||
errors[name] = e.messages
|
errors[name] = e.messages
|
||||||
|
if name in self.cleaned_data:
|
||||||
|
del self.cleaned_data[name]
|
||||||
try:
|
try:
|
||||||
self.cleaned_data = self.clean()
|
self.cleaned_data = self.clean()
|
||||||
except ValidationError, e:
|
except ValidationError, e:
|
||||||
|
|
Loading…
Reference in New Issue