Merge pull request #2048 from loic/ValidationError.message_dict

Trigger AttributeError in ValidationError.message_dict when error_dict is missing.
This commit is contained in:
Florian Apolloner 2013-12-08 05:06:39 -08:00
commit c78bd9eff2
1 changed files with 4 additions and 0 deletions

View File

@ -123,6 +123,10 @@ class ValidationError(Exception):
@property @property
def message_dict(self): def message_dict(self):
# Trigger an AttributeError if this ValidationError
# doesn't have an error_dict.
getattr(self, 'error_dict')
return dict(self) return dict(self)
@property @property