Ticket #3515: forms.2.diff
File forms.2.diff, 958 bytes (added by , 18 years ago) |
---|
-
django/newforms/forms.py
167 167 if hasattr(self, 'clean_%s' % name): 168 168 value = getattr(self, 'clean_%s' % name)() 169 169 self.clean_data[name] = value 170 # Revert field css class back to initial value 171 if field.widget.attrs.has_key('class'): 172 if field.css: 173 field.widget.attrs.update({'class': str(field.css)}) 174 else: 175 del field.widget.attrs['class'] 170 176 except ValidationError, e: 171 177 errors[name] = e.messages 178 # Prepend 'error' to field css class 179 field.widget.attrs.update({'class': ('error ' + str(field.css)).rstrip()}) 172 180 try: 173 181 self.clean_data = self.clean() 174 182 except ValidationError, e: