diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2018-08-29 15:19:32 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-08-29 06:19:32 -0400 |
| commit | 54b331451cb22ee354beadf31ee42cbd714877f0 (patch) | |
| tree | 45995cff685b07fe7742e6286174342bf6622011 | |
| parent | 39461a83c33f0cfe719d3b139413d1f5d1e75d5e (diff) | |
Refs #29689 -- Moved FilePathField choices sorting outside the loop.
| -rw-r--r-- | django/forms/fields.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 9cc93a46e1..a977256525 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -1113,7 +1113,7 @@ class FilePathField(ChoiceField): (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 |
