Optimize the version list screen

master
David Fischer 2019-03-14 14:51:53 -07:00
parent 54397a07a1
commit 89f1913944
No known key found for this signature in database
GPG Key ID: F0C9B0ADA737AB60
1 changed files with 4 additions and 0 deletions

View File

@ -13,6 +13,7 @@ from django.contrib import messages
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.files.storage import get_storage_class
from django.db.models import prefetch_related_objects
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
@ -271,6 +272,9 @@ def project_versions(request, project_slug):
if wiped and wiped_version.count():
messages.success(request, 'Version wiped: ' + wiped)
# Optimize for the future project permission checks
prefetch_related_objects([project], 'users')
return render(
request,
'projects/project_version_list.html',