summaryrefslogtreecommitdiff
path: root/django/forms
diff options
context:
space:
mode:
Diffstat (limited to 'django/forms')
-rw-r--r--django/forms/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/forms/models.py b/django/forms/models.py
index c8626f57b2..b259a8df28 100644
--- a/django/forms/models.py
+++ b/django/forms/models.py
@@ -1155,7 +1155,8 @@ class ModelChoiceField(ChoiceField):
def __deepcopy__(self, memo):
result = super(ChoiceField, self).__deepcopy__(memo)
# Need to force a new ModelChoiceIterator to be created, bug #11183
- result.queryset = self.queryset.all()
+ if self.queryset is not None:
+ result.queryset = self.queryset.all()
return result
def _get_queryset(self):