From 198127a0f272e1af60c2e00befe80c96cf498a7f Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 26 May 2007 08:47:15 +0000 Subject: [PATCH] Fixed #4390, #4385 -- Made it clear that cleaned_data wasn't being assigned to 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 --- django/newforms/forms.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django/newforms/forms.py b/django/newforms/forms.py index 952f41a8c9..6c76314094 100644 --- a/django/newforms/forms.py +++ b/django/newforms/forms.py @@ -188,9 +188,11 @@ class BaseForm(StrAndUnicode): self.cleaned_data[name] = value if hasattr(self, 'clean_%s' % name): value = getattr(self, 'clean_%s' % name)() - self.cleaned_data[name] = value + self.cleaned_data[name] = value except ValidationError, e: errors[name] = e.messages + if name in self.cleaned_data: + del self.cleaned_data[name] try: self.cleaned_data = self.clean() except ValidationError, e: