simpler raising of ValidatioError
This commit is contained in:
		| @@ -161,9 +161,7 @@ class BaseField(object): | |||||||
|         """Raises a ValidationError. |         """Raises a ValidationError. | ||||||
|         """ |         """ | ||||||
|         field_name = field_name if field_name else self.name |         field_name = field_name if field_name else self.name | ||||||
|         error = ValidationError(message, field_name=field_name) |         raise ValidationError(message, errors=errors, field_name=field_name) | ||||||
|         error.errors = errors if errors else {} |  | ||||||
|         raise error |  | ||||||
|  |  | ||||||
|     def to_python(self, value): |     def to_python(self, value): | ||||||
|         """Convert a MongoDB-compatible type to a Python type. |         """Convert a MongoDB-compatible type to a Python type. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user