[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:
Aymeric Augustin 2013-01-24 11:12:48 +01:00
parent 1c061ef568
commit 9328ef0e84
1 changed files with 1 additions and 1 deletions

View File

@ -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)