Skip to content

Commit

Permalink
Merge pull request #955 from armonge/perf/n+1-queries-on-recover-list
Browse files Browse the repository at this point in the history
perf: Fixes N+1 queries while rendering the recover_list.html template
  • Loading branch information
etianen authored Dec 20, 2023
2 parents 44c1b43 + d0c9f3c commit 790f846
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion reversion/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ def recoverlist_view(self, request, extra_context=None):
raise PermissionDenied
model = self.model
opts = model._meta
deleted = self._reversion_order_version_queryset(Version.objects.get_deleted(self.model))
deleted = self._reversion_order_version_queryset(
Version.objects.get_deleted(self.model).select_related("revision")
)
# Set the app name.
request.current_app = self.admin_site.name
# Get the rest of the context.
Expand Down

0 comments on commit 790f846

Please sign in to comment.