Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #3718 -- Exposed form errors to cleaning methods as soon as the…

…y are

available. Patch from Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a901b44c15d024a7a15ccbff5d167118427b924c 1 parent 1c42c7c
Malcolm Tredinnick authored May 26, 2007

Showing 1 changed file with 4 additions and 6 deletions. Show diff stats Hide diff stats

  1. 10  django/newforms/forms.py
10  django/newforms/forms.py
@@ -174,9 +174,8 @@ def full_clean(self):
174 174
         Cleans all of self.data and populates self._errors and
175 175
         self.cleaned_data.
176 176
         """
177  
-        errors = ErrorDict()
  177
+        self._errors = ErrorDict()
178 178
         if not self.is_bound: # Stop further processing.
179  
-            self._errors = errors
180 179
             return
181 180
         self.cleaned_data = {}
182 181
         for name, field in self.fields.items():
@@ -191,16 +190,15 @@ def full_clean(self):
191 190
                     value = getattr(self, 'clean_%s' % name)()
192 191
                     self.cleaned_data[name] = value
193 192
             except ValidationError, e:
194  
-                errors[name] = e.messages
  193
+                self._errors[name] = e.messages
195 194
                 if name in self.cleaned_data:
196 195
                     del self.cleaned_data[name]
197 196
         try:
198 197
             self.cleaned_data = self.clean()
199 198
         except ValidationError, e:
200  
-            errors[NON_FIELD_ERRORS] = e.messages
201  
-        if errors:
  199
+            self._errors[NON_FIELD_ERRORS] = e.messages
  200
+        if self._errors:
202 201
             delattr(self, 'cleaned_data')
203  
-        self._errors = errors
204 202
 
205 203
     def clean(self):
206 204
         """

0 notes on commit a901b44

Please sign in to comment.
Something went wrong with that request. Please try again.