Skip to content

Commit

Permalink
Fix prefetching for include param fields
Browse files Browse the repository at this point in the history
  • Loading branch information
stevelacey committed Jan 13, 2023
1 parent 451a46c commit ec2edbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion worf/views/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ def get_processed_queryset(self):
)

if self.include_fields and self.bundle.get("include"):
for item in set(self.include_fields.keys()) & set(self.bundle["include"]):
include = field_list(self.bundle["include"])
for item in set(self.include_fields.keys()) & set(include):
if isinstance(self.include_fields[item], Prefetch):
queryset = queryset.prefetch_related(self.include_fields[item])
elif isinstance(self.include_fields[item], str):
Expand Down

0 comments on commit ec2edbd

Please sign in to comment.