mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
fix an error that required attribute not work on ManyRelatedField
This commit is contained in:
parent
2749b12eaf
commit
bbea7c42bc
|
@ -349,9 +349,9 @@ class ManyRelatedField(Field):
|
||||||
if self.field_name not in dictionary:
|
if self.field_name not in dictionary:
|
||||||
if getattr(self.root, 'partial', False):
|
if getattr(self.root, 'partial', False):
|
||||||
return empty
|
return empty
|
||||||
return dictionary.getlist(self.field_name)
|
return dictionary.getlist(self.field_name) or empty
|
||||||
|
|
||||||
return dictionary.get(self.field_name, empty)
|
return dictionary.get(self.field_name, empty) or empty
|
||||||
|
|
||||||
def to_internal_value(self, data):
|
def to_internal_value(self, data):
|
||||||
return [
|
return [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user