diff --git a/.gitignore b/.gitignore index d24c987176..e0280c51b9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ coverage.* !.github !.gitignore !.pre-commit-config.yaml + +.idea \ No newline at end of file diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 8aced6a9c8..1081328f76 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1680,18 +1680,36 @@ def __init__(self, **kwargs): self.validators.append(MinLengthValidator(self.min_length, message=message)) def get_value(self, dictionary): - if self.field_name not in dictionary: - if getattr(self.root, 'partial', False): - return empty # We override the default field access in order to support # lists in HTML forms. if html.is_html_input(dictionary): - val = dictionary.getlist(self.field_name, []) - if len(val) > 0: - # Support QueryDict lists in HTML input. + # First, try to get the value using the plain field name with getlist. + # This handles standard HTML form list submissions like: + #