mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-23 15:54:16 +03:00
Fix for empty form fields
This commit is contained in:
parent
f4ad77ac04
commit
27c93c08d2
|
@ -250,7 +250,10 @@ class ManyPrimaryKeyRelatedField(PrimaryKeyRelatedField):
|
|||
value = data.getlist(field_name)
|
||||
except:
|
||||
value = data.get(field_name)
|
||||
into[field_name] = [self.from_native(item) for item in value if item]
|
||||
else:
|
||||
if value == ['']:
|
||||
value = []
|
||||
into[field_name] = [self.from_native(item) for item in value]
|
||||
|
||||
|
||||
class NaturalKeyRelatedField(RelatedField):
|
||||
|
|
Loading…
Reference in New Issue
Block a user