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