mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-30 01:49:50 +03:00
Fix nullable source='*'
fields
This commit is contained in:
parent
5b809a9b6f
commit
3ad0bcdc88
|
@ -493,6 +493,11 @@ class Field:
|
|||
if data is None:
|
||||
if not self.allow_null:
|
||||
self.fail('null')
|
||||
# Nullable `source='*'` fields should not be skipped when its named
|
||||
# field is given a null value. This is because `source='*'` means
|
||||
# the field is passed the entire object, which is not null.
|
||||
elif self.source == '*':
|
||||
return (False, None)
|
||||
return (True, None)
|
||||
|
||||
return (False, data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user