Fix merge conflict

This commit is contained in:
Diana Huang
2014-07-10 10:44:08 -04:00
parent cfb7f99c8e
commit 97331d4c16
5 changed files with 14 additions and 22 deletions

View File

@@ -15,7 +15,6 @@ from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.django import modulestore
from xmodule.modulestore.exceptions import ItemNotFoundError
from opaque_keys.edx.keys import UsageKey, CourseKey
from xmodule.modulestore.store_utilities import delete_course
from student.roles import CourseInstructorRole, CourseStaffRole

View File

@@ -532,15 +532,12 @@ def _get_item(request, data):
Returns the item.
"""
usage_key = UsageKey.from_string(data.get('locator'))
# usage_key's course_key may have an empty run property
usage_key = usage_key.replace(course_key=modulestore().fill_in_run(usage_key.course_key))
# This is placed before has_course_access() to validate the location,
# because has_course_access() raises r if location is invalid.
item = modulestore().get_item(usage_key)
if not has_course_access(request.user, usage_key.course_key):
# use the item's course_key, because the usage_key might not have the run
if not has_course_access(request.user, item.location.course_key):
raise PermissionDenied()
return item