mirror of
https://github.com/django/django.git
synced 2025-09-27 12:39:17 +00:00
Fixed #30482 -- Prevented unnecessary evaluation of lookup.queryset in prefetch_related_objects().
This commit is contained in:
parent
4442ee8a51
commit
59ffafa1d2
2 changed files with 11 additions and 6 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue