mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Tweak empty list implementation
This commit is contained in:
parent
be6df3ae3c
commit
e24d29ec05
|
@ -129,8 +129,8 @@ class RelatedField(WritableField):
|
||||||
try:
|
try:
|
||||||
# Form data
|
# Form data
|
||||||
value = data.getlist(field_name)
|
value = data.getlist(field_name)
|
||||||
if value == ['']:
|
if value == [''] or value == []:
|
||||||
value = []
|
raise KeyError
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# Non-form data
|
# Non-form data
|
||||||
value = data[field_name]
|
value = data[field_name]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user