simpler raising of ValidatioError
This commit is contained in:
parent
7db5335420
commit
b8e2bdc99f
1 changed files with 1 additions and 3 deletions
|
|
@ -161,9 +161,7 @@ class BaseField(object):
|
|||
"""Raises a ValidationError.
|
||||
"""
|
||||
field_name = field_name if field_name else self.name
|
||||
error = ValidationError(message, field_name=field_name)
|
||||
error.errors = errors if errors else {}
|
||||
raise error
|
||||
raise ValidationError(message, errors=errors, field_name=field_name)
|
||||
|
||||
def to_python(self, value):
|
||||
"""Convert a MongoDB-compatible type to a Python type.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue