Skip to content

Commit

Permalink
Refs #29689 -- Moved FilePathField choices sorting outside the loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-sigurd authored and timgraham committed Aug 29, 2018
1 parent 39461a8 commit 54b3314
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django/forms/fields.py
Expand Up @@ -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
Expand Down

0 comments on commit 54b3314

Please sign in to comment.