Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

Commit

Permalink
bug 1269104: Add another field to avoid a query
Browse files Browse the repository at this point in the history
Pre-fetch document.current_revision_id to avoid loading it from the
database in wiki/list/revisions.html
  • Loading branch information
jwhitlock committed Jul 7, 2017
1 parent 7fcf9ff commit 8b941c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kuma/wiki/views/list.py
Expand Up @@ -146,6 +146,7 @@ def revisions(request, document_slug, document_locale):
# Load document with only fields for history display
doc_query = (Document.objects
.only('id', 'locale', 'slug', 'title',
'current_revision_id',
'parent__slug', 'parent__locale')
.select_related('parent__slug', 'parent__locale')
.exclude(current_revision__isnull=True)
Expand Down

0 comments on commit 8b941c7

Please sign in to comment.