Browse files

[1.5.x] Avoided a possible regression in 5097d3c.

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.
  • Loading branch information...
1 parent 1c061ef commit 9328ef0e84db2559af56d24c40e6b24b74e29a6f @aaugustin aaugustin committed Jan 24, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/forms/
@@ -715,7 +715,7 @@ def __init__(self, data=None, files=None, instance=None,
qs = queryset.filter(**{ self.instance})
- qs = queryset.none()
+ qs = queryset.filter(pk__in=[])
super(BaseInlineFormSet, self).__init__(data, files, prefix=prefix,
queryset=qs, **kwargs)

0 comments on commit 9328ef0

Please sign in to comment.