Ticket #3515: forms.diff
File forms.diff, 696 bytes (added by , 18 years ago) |
---|
-
forms.py
169 169 self.clean_data[name] = value 170 170 except ValidationError, e: 171 171 errors[name] = e.messages 172 # Prepend 'error' to field css class 173 css = ['error'] 174 if field.widget.attrs.has_key('class'): 175 css = css + field.widget.attrs['class'].split() 176 if css.count('error') > 1: css.remove('error') 177 field.widget.attrs.update({'class': ' '.join(css)}) 172 178 try: 173 179 self.clean_data = self.clean() 174 180 except ValidationError, e: