mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 10:03:57 +03:00
Add explaining comment
This commit is contained in:
parent
6b962cfcf7
commit
3873bc8a85
|
@ -191,6 +191,8 @@ class WritableField(Field):
|
||||||
except KeyError:
|
except KeyError:
|
||||||
if self.default is not None and not self.root.partial:
|
if self.default is not None and not self.root.partial:
|
||||||
native = self.default
|
native = self.default
|
||||||
|
# partial serializers shouldn't set the default field to avoid
|
||||||
|
# overriding the previously set value
|
||||||
else:
|
else:
|
||||||
if self.required:
|
if self.required:
|
||||||
raise ValidationError(self.error_messages['required'])
|
raise ValidationError(self.error_messages['required'])
|
||||||
|
|
Loading…
Reference in New Issue
Block a user