mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-27 03:54:01 +03:00
Fix processing of ManyToManyField when it is empty
Signed-off-by: Fernando Rocha <fernandogrd@gmail.com>
This commit is contained in:
parent
1929159db1
commit
fceacd830f
|
@ -148,7 +148,7 @@ class ManyRelatedMixin(object):
|
||||||
value = data.getlist(self.source or field_name)
|
value = data.getlist(self.source or field_name)
|
||||||
except:
|
except:
|
||||||
# Non-form data
|
# Non-form data
|
||||||
value = data.get(self.source or field_name)
|
value = data.get(self.source or field_name, [])
|
||||||
else:
|
else:
|
||||||
if value == ['']:
|
if value == ['']:
|
||||||
value = []
|
value = []
|
||||||
|
|
Loading…
Reference in New Issue
Block a user