Merge pull request #193 from colinhowe/dev
Improved Validation warnings - Thanks Colin Howe
This commit is contained in:
commit
e518c51de3
1 changed files with 2 additions and 2 deletions
|
|
@ -628,8 +628,8 @@ class BaseDocument(object):
|
|||
try:
|
||||
field._validate(value)
|
||||
except (ValueError, AttributeError, AssertionError), e:
|
||||
raise ValidationError('Invalid value for field of type "%s": %s'
|
||||
% (field.__class__.__name__, value))
|
||||
raise ValidationError('Invalid value for field named "%s" of type "%s": %s'
|
||||
% (field.name, field.__class__.__name__, value))
|
||||
elif field.required:
|
||||
raise ValidationError('Field "%s" is required' % field.name)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue