Merge pull request #242 from chrisbrantley/chrisbrantley-patch-1

Wrap call to key() in list() so it can be indexed
fix_request_path_info
Diederik van der Boor 2016-10-04 10:31:51 +02:00 committed by GitHub
commit 3dcb8e7e06
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ class BasePolymorphicModelFormSet(BaseModelFormSet):
# Extra forms, cycle between all types # Extra forms, cycle between all types
# TODO: take the 'extra' value of each child formset into account. # TODO: take the 'extra' value of each child formset into account.
total_known = len(self.queryset_data) total_known = len(self.queryset_data)
child_models = self.child_forms.keys() child_models = list(self.child_forms.keys())
model = child_models[(i - total_known) % len(child_models)] model = child_models[(i - total_known) % len(child_models)]
form_class = self.get_form_class(model) form_class = self.get_form_class(model)