Fix merge conflict
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user