diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-26 08:47:15 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-26 08:47:15 +0000 |
| commit | 198127a0f272e1af60c2e00befe80c96cf498a7f (patch) | |
| tree | 4b93483ac2dcc09ab9d533adffac9c8d6ebd1415 | |
| parent | dfdf7bdc5e0c11143b3f11ddfa3dc755013ccbfb (diff) | |
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
| -rw-r--r-- | django/newforms/forms.py | 4 |
1 files changed, 3 insertions, 1 deletions
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: |
