diff --git a/django/forms/fields.py b/django/forms/fields.py index 9cc93a46e1c9c..a977256525371 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -1113,7 +1113,7 @@ def __init__(self, path, *, match=None, recursive=False, allow_files=True, (self.allow_folders and f.is_dir())) and (self.match is None or self.match_re.search(f.name))): choices.append((f.path, f.name)) - choices.sort(key=operator.itemgetter(1)) + choices.sort(key=operator.itemgetter(1)) self.choices.extend(choices) self.widget.choices = self.choices