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