forked from DGNum/gestioCOF
Fewer queries on poll view
This commit is contained in:
parent
ce70269e7b
commit
8870b5ace2
1 changed files with 4 additions and 1 deletions
|
@ -94,7 +94,10 @@ def logout(request):
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def survey(request, survey_id):
|
def survey(request, survey_id):
|
||||||
survey = get_object_or_404(Survey, id=survey_id)
|
survey = get_object_or_404(
|
||||||
|
Survey.objects.prefetch_related('questions', 'questions__answers'),
|
||||||
|
id=survey_id,
|
||||||
|
)
|
||||||
if not survey.survey_open or survey.old:
|
if not survey.survey_open or survey.old:
|
||||||
raise Http404
|
raise Http404
|
||||||
success = False
|
success = False
|
||||||
|
|
Loading…
Reference in a new issue