mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-30 18:09:59 +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 data is None:
|
||||||
if not self.allow_null:
|
if not self.allow_null:
|
||||||
self.fail('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 (True, None)
|
||||||
|
|
||||||
return (False, data)
|
return (False, data)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user