Ticket #5328: newforms-choice-field-clean-r6040.diff

File newforms-choice-field-clean-r6040.diff, 625 bytes (added by Ramiro Morales, 17 years ago)
  • fields.py

    old new  
    469469        """
    470470        value = super(ChoiceField, self).clean(value)
    471471        if value in EMPTY_VALUES:
    472             value = u''
     472            return u''
    473473        value = smart_unicode(value)
    474         if value == u'':
    475             return value
    476474        valid_values = set([smart_unicode(k) for k, v in self.choices])
    477475        if value not in valid_values:
    478476            raise ValidationError(ugettext(u'Select a valid choice. That choice is not one of the available choices.'))
Back to Top