This commit is contained in:
Ryan Adams 2017-05-27 12:01:10 +00:00 committed by GitHub
commit 32a56e456e

View File

@ -181,7 +181,7 @@ class BaseSerializer(Field):
'You must call `.is_valid()` before calling `.save()`.' 'You must call `.is_valid()` before calling `.save()`.'
) )
assert not self.errors, ( assert not self._errors, (
'You cannot call `.save()` on a serializer with invalid data.' 'You cannot call `.save()` on a serializer with invalid data.'
) )
@ -242,7 +242,7 @@ class BaseSerializer(Field):
self._errors = {} self._errors = {}
if self._errors and raise_exception: if self._errors and raise_exception:
raise ValidationError(self.errors) raise ValidationError(self._errors)
return not bool(self._errors) return not bool(self._errors)