mirror of
https://github.com/django/django.git
synced 2025-10-25 06:36:07 +00:00
Fixed #11183 - BaseForm init leaves pointers pointing back to base_fields
Thanks to margieroginski for the report git-svn-id: http://code.djangoproject.com/svn/django/trunk@12733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -923,6 +923,12 @@ class ModelChoiceField(ChoiceField):
|
||||
self.choice_cache = None
|
||||
self.to_field_name = to_field_name
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
result = super(ChoiceField, self).__deepcopy__(memo)
|
||||
# Need to force a new ModelChoiceIterator to be created, bug #11183
|
||||
result.queryset = result.queryset
|
||||
return result
|
||||
|
||||
def _get_queryset(self):
|
||||
return self._queryset
|
||||
|
||||
|
||||
Reference in New Issue
Block a user