From 26d0023cccd08473b0acc90e6f06bf3e93ebd847 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 18 Jun 2016 10:33:37 -0400 Subject: Refs #15667 -- Fixed crash when indexing RadioFieldRenderer with ModelChoiceIterator. Regression in 86573861a95e5a47dc7ff906443117d75b73dca1 --- django/forms/widgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/forms') diff --git a/django/forms/widgets.py b/django/forms/widgets.py index ab9794a1e7..604a6a401a 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -693,7 +693,7 @@ class ChoiceFieldRenderer(object): self.choices = choices def __getitem__(self, idx): - choice = self.choices[idx] # Let the IndexError propagate + choice = list(self.choices)[idx] # Let the IndexError propagate return self.choice_input_class(self.name, self.value, self.attrs.copy(), choice, idx) def __str__(self): -- cgit v1.3