[1.5.x] Avoided a possible regression in 5097d3c5
.
QuerySet.none() returns an instance of EmptyQuerySet, which may have undesirable side effects in the presence of custom query set classes. The implementation of .none() was refactored in master to have the same effect as .filter(pk__in=[]). Refs #19652. Thanks Simon Charrette for the report.
This commit is contained in:
parent
1c061ef568
commit
9328ef0e84
|
@ -715,7 +715,7 @@ class BaseInlineFormSet(BaseModelFormSet):
|
|||
if self.instance.pk:
|
||||
qs = queryset.filter(**{self.fk.name: self.instance})
|
||||
else:
|
||||
qs = queryset.none()
|
||||
qs = queryset.filter(pk__in=[])
|
||||
super(BaseInlineFormSet, self).__init__(data, files, prefix=prefix,
|
||||
queryset=qs, **kwargs)
|
||||
|
||||
|
|
Loading…
Reference in New Issue