From 1a5edcd998d45d81439e900622c8b55c931d2930 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Mon, 16 Sep 2013 14:26:46 -0400 Subject: [PATCH] we already have the descriptor, so call get_module_for_descriptor() rather than refecting that subtree which is multiple round-trips to DB fix line indents --- lms/djangoapps/courseware/views.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 500d818672..695d7ea55d 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -375,9 +375,14 @@ def index(request, course_id, chapter=None, section=None, # html, which in general will need all of its children section_field_data_cache = FieldDataCache.cache_for_descriptor_descendents( course_id, user, section_descriptor, depth=None) - section_module = get_module(request.user, request, - section_descriptor.location, - section_field_data_cache, course_id, position, depth=None) + + section_module = get_module_for_descriptor(request.user, + request, + section_descriptor, + section_field_data_cache, + course_id, + position + ) if section_module is None: # User may be trying to be clever and access something