mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #27975 -- Fixed crash if ModelChoiceField's queryset=None.
Regression in 9153d8fbd6385db9f48793662de789fc3d686841.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user