Skip to content

Commit

Permalink
Optimise queries in WorkflowObjectsToModeratePanel using prefetch_rel…
Browse files Browse the repository at this point in the history
…ated()
  • Loading branch information
laymonage committed Aug 24, 2023
1 parent 9775809 commit 143430a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wagtail/admin/views/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@ def get_context_data(self, parent_context):
"task",
"revision__user",
)
.prefetch_related(
"revision__content_object",
"revision__content_object__latest_revision",
"revision__content_object__live_revision",
)
.order_by("-started_at")
)
for state in states:
Expand Down

0 comments on commit 143430a

Please sign in to comment.