summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/core/exceptions.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/core/exceptions.py b/django/core/exceptions.py
index 5ccd3e8c63..ee6d5fe37b 100644
--- a/django/core/exceptions.py
+++ b/django/core/exceptions.py
@@ -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: