summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorIain Watts <iain@rover.com>2019-05-15 16:09:16 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-05-16 21:39:55 +0200
commit59ffafa1d2f466fa7aacbe74fe2787b2004b7871 (patch)
tree40f3bcab87648184de222f72c17608f680dbeba6 /django/db
parent4442ee8a51ad04730e4af2833728c345042b69cf (diff)
Fixed #30482 -- Prevented unnecessary evaluation of lookup.queryset in prefetch_related_objects().
Diffstat (limited to 'django/db')
-rw-r--r--django/db/models/query.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/query.py b/django/db/models/query.py
index a21a091af0..1544beb613 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -1556,7 +1556,7 @@ def prefetch_related_objects(model_instances, *related_lookups):
while all_lookups:
lookup = all_lookups.pop()
if lookup.prefetch_to in done_queries:
- if lookup.queryset:
+ if lookup.queryset is not None:
raise ValueError("'%s' lookup was already seen with a different queryset. "
"You may need to adjust the ordering of your lookups." % lookup.prefetch_to)