1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #13352 -- Added __repr__ method for Validation Error. Thanks to elpaso66 for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-04-15 11:19:59 +00:00
parent 1cec641669
commit d9aaad4e36
2 changed files with 19 additions and 1 deletions

View File

@@ -64,6 +64,11 @@ class ValidationError(Exception):
return repr(self.message_dict)
return repr(self.messages)
def __repr__(self):
if hasattr(self, 'message_dict'):
return 'ValidationError(%s)' % repr(self.message_dict)
return 'ValidationError(%s)' % repr(self.messages)
def update_error_dict(self, error_dict):
if hasattr(self, 'message_dict'):
if error_dict: