You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have reduced the issue to the simplest possible case.
I have included a failing test as a pull request. (If you are unable to do so we can still accept the issue.)
Issue
The docstring of Field.get_default says:
If a default has not been set for this field then this will simply
return empty, indicating that no value should be set in the
validated data for this field.
But if default has not been set the method raises SkipField instead.
ifself.defaultisemptyorgetattr(self.root, 'partial', False):
# No default, or this is a partial update.raiseSkipField()
I suggest either to change the documentation to reflect the actual behaviour or change the code to reflect the doc.
Checklist
master
branch of Django REST framework.Issue
The docstring of
Field.get_default
says:But if default has not been set the method raises
SkipField
instead.I suggest either to change the documentation to reflect the actual behaviour or change the code to reflect the doc.
https://github.com/tomchristie/django-rest-framework/blob/master/rest_framework/fields.py#L434
The text was updated successfully, but these errors were encountered: