Ticket #12698: r12344_ticket12698.diff
File r12344_ticket12698.diff, 1.4 KB (added by , 15 years ago) |
---|
-
django/forms/models.py
306 306 try: 307 307 self.instance.clean_fields(exclude=exclude) 308 308 except ValidationError, e: 309 self._update_errors(e.message_dict) 309 if hasattr(e, 'message_dict'): 310 self._update_errors(e.message_dict) 311 else: 312 self._update_errors({NON_FIELD_ERRORS: e.messages}) 310 313 311 314 def _clean_form(self): 312 315 """ … … 317 320 try: 318 321 self.instance.clean() 319 322 except ValidationError, e: 320 self._update_errors(e.message_dict) 323 if hasattr(e, 'message_dict'): 324 self._update_errors(e.message_dict) 325 else: 326 self._update_errors({NON_FIELD_ERRORS: e.messages}) 321 327 super(BaseModelForm, self)._clean_form() 322 328 323 329 def validate_unique(self): … … 329 335 try: 330 336 self.instance.validate_unique(exclude=exclude) 331 337 except ValidationError, e: 332 self._update_errors(e.message_dict) 338 if hasattr(e, 'message_dict'): 339 self._update_errors(e.message_dict) 340 else: 341 self._update_errors({NON_FIELD_ERRORS: e.messages}) 333 342 334 343 def save(self, commit=True): 335 344 """