Only get the current version for docs pages if we need it

This commit is contained in:
Magnus Hagander
2019-03-31 14:24:52 +02:00
parent 76f4154106
commit a23b22f8d5

View File

@ -24,11 +24,8 @@ from .forms import DocCommentForm
@content_sources('style', "'unsafe-inline'")
def docpage(request, version, filename):
loaddate = None
# Get the current version both to map the /current/ url, and to later
# determine if we allow comments on this page.
currver = Version.objects.filter(current=True)[0].tree
if version == 'current':
ver = currver
ver = Version.objects.filter(current=True)[0].tree
elif version == 'devel':
ver = Decimal(0)
loaddate = Version.objects.get(tree=Decimal(0)).docsloaded