mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Refs #15667 -- Fixed crash when indexing RadioFieldRenderer with ModelChoiceIterator.
Regression in 86573861a9
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user