From 5d9fad5a5250ed3c0e4bb0e6ad7618f5535cc24b Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Tue, 14 Aug 2012 23:16:02 -0400 Subject: [PATCH] Minor cleanups before pull request --- lms/djangoapps/courseware/access.py | 2 +- lms/djangoapps/courseware/module_render.py | 11 +---------- lms/djangoapps/courseware/views.py | 2 -- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/lms/djangoapps/courseware/access.py b/lms/djangoapps/courseware/access.py index 8039d16896..9605c827de 100644 --- a/lms/djangoapps/courseware/access.py +++ b/lms/djangoapps/courseware/access.py @@ -14,7 +14,7 @@ from xmodule.timeparse import parse_time from xmodule.x_module import XModule, XModuleDescriptor -DEBUG_ACCESS = True +DEBUG_ACCESS = False log = logging.getLogger(__name__) diff --git a/lms/djangoapps/courseware/module_render.py b/lms/djangoapps/courseware/module_render.py index b97fab1077..8b4d52628c 100644 --- a/lms/djangoapps/courseware/module_render.py +++ b/lms/djangoapps/courseware/module_render.py @@ -143,15 +143,12 @@ def get_module(user, request, location, student_module_cache, position=None): Returns: xmodule instance ''' - # has_access below needs an actual Location - location = Location(location) descriptor = modulestore().get_item(location) # Short circuit--if the user shouldn't have access, bail without doing any work if not has_access(user, descriptor, 'load'): return None - #TODO Only check the cache if this module can possibly have state instance_module = None shared_module = None @@ -165,22 +162,16 @@ def get_module(user, request, location, student_module_cache, position=None): shared_module = student_module_cache.lookup(descriptor.category, shared_state_key) - - instance_state = instance_module.state if instance_module is not None else None shared_state = shared_module.state if shared_module is not None else None - # TODO (vshnayder): fix hardcoded urls (use reverse) # Setup system context for module instance - ajax_url = reverse('modx_dispatch', kwargs=dict(course_id=descriptor.location.course_id, id=descriptor.location.url(), dispatch=''), ) - # ajax_url = settings.MITX_ROOT_URL + '/modx/' + descriptor.location.url() + '/' - # Fully qualified callback URL for external queueing system xqueue_callback_url = request.build_absolute_uri('/')[:-1] # Trailing slash provided by reverse xqueue_callback_url += reverse('xqueue_callback', @@ -225,7 +216,7 @@ def get_module(user, request, location, student_module_cache, position=None): ) # pass position specified in URL to module through ModuleSystem system.set('position', position) - system.set('DEBUG',settings.DEBUG) + system.set('DEBUG', settings.DEBUG) module = descriptor.xmodule_constructor(system)(instance_state, shared_state) diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 97bafb3e0f..ab63872170 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -333,8 +333,6 @@ def grade_summary(request, course_id): def instructor_dashboard(request, course_id): """Display the instructor dashboard for a course.""" course = get_course_with_access(request.user, course_id, 'staff') - if not has_access(request.user, course, 'staff'): - raise Http404 # For now, just a static page context = {'course': course }