mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #20989 -- Removed explicit list comprehension inside dict() and tuple()
Thanks jeroen.pulles at redslider.net for the suggestion and helper script.
This commit is contained in:
@@ -543,7 +543,7 @@ class BaseModelFormSet(BaseFormSet):
|
||||
|
||||
def _existing_object(self, pk):
|
||||
if not hasattr(self, '_object_dict'):
|
||||
self._object_dict = dict([(o.pk, o) for o in self.get_queryset()])
|
||||
self._object_dict = dict((o.pk, o) for o in self.get_queryset())
|
||||
return self._object_dict.get(pk)
|
||||
|
||||
def _construct_form(self, i, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user