Ticket #11303: clean_initial_value.diff

File clean_initial_value.diff, 735 bytes (added by Alexander Lyabah, 15 years ago)
  • django/forms/forms.py

     
    287287                    hidden_widget = field.hidden_widget()
    288288                    initial_value = hidden_widget.value_from_datadict(
    289289                        self.data, self.files, initial_prefixed_name)
     290                    try:
     291                        initial_value = field.clean(initial_value)
     292                    except ValidationError:
     293                        pass
    290294                if field.widget._has_changed(initial_value, data_value):
    291295                    self._changed_data.append(name)
    292296        return self._changed_data
Back to Top