Ticket #5524: ticket_5524__revision_6369.diff

File ticket_5524__revision_6369.diff, 903 bytes (added by __hawkeye__, 8 years ago)

cleaned_data is persisted for fields that do not have validation errors. (corrected typo in previous)

  • django/newforms/forms.py

     
    202202            self.cleaned_data = self.clean()
    203203        except ValidationError, e:
    204204            self._errors[NON_FIELD_ERRORS] = e.messages
    205         if self._errors:
    206             delattr(self, 'cleaned_data')
    207205
    208206    def clean(self):
    209207        """
     
    298296        """
    299297        Returns the data for this BoundField, or None if it wasn't given.
    300298        """
    301         return self.field.widget.value_from_datadict(self.form.data, self.form.files, self.html_name)
     299        return self.form.cleaned_data.get(self.name, self.field.widget.value_from_datadict(self.form.data, self.form.files, self.html_name))
    302300    data = property(_data)
    303301
    304302    def label_tag(self, contents=None, attrs=None):
Back to Top