summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Apolloner <florian@apolloner.eu>2013-12-08 05:06:39 -0800
committerFlorian Apolloner <florian@apolloner.eu>2013-12-08 05:06:39 -0800
commitc78bd9eff2f7751c7e40b411221c516859b827da (patch)
tree9670cbbe25690942b7a225871256a8dc5afd3a7a
parentd653c0bd2ea25a53ac5f76cb854cc1b3e083ea0e (diff)
parent2e3c7d882015375c130c21884d83cb9fb7759d94 (diff)
Merge pull request #2048 from loic/ValidationError.message_dict
Trigger AttributeError in ValidationError.message_dict when error_dict is missing.
-rw-r--r--django/core/exceptions.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/django/core/exceptions.py b/django/core/exceptions.py
index 78f6d07cf3..cf4aea0f36 100644
--- a/django/core/exceptions.py
+++ b/django/core/exceptions.py
@@ -123,6 +123,10 @@ class ValidationError(Exception):
@property
def message_dict(self):
+ # Trigger an AttributeError if this ValidationError
+ # doesn't have an error_dict.
+ getattr(self, 'error_dict')
+
return dict(self)
@property