fix up call signatures for get_parent_locations()

This commit is contained in:
Chris Dodge
2013-01-11 14:29:53 -05:00
parent 08adf9c0d5
commit 9479ef3c84
3 changed files with 5 additions and 6 deletions

View File

@@ -202,7 +202,7 @@ def edit_subsection(request, location):
if item.location.category != 'sequential':
return HttpResponseBadRequest()
parent_locs = modulestore().get_parent_locations(location)
parent_locs = modulestore().get_parent_locations(location, None)
# we're for now assuming a single parent
if len(parent_locs) != 1:
@@ -285,10 +285,10 @@ def edit_unit(request, location):
# this will need to change to check permissions correctly so as
# to pick the correct parent subsection
containing_subsection_locs = modulestore().get_parent_locations(location)
containing_subsection_locs = modulestore().get_parent_locations(location, None)
containing_subsection = modulestore().get_item(containing_subsection_locs[0])
containing_section_locs = modulestore().get_parent_locations(containing_subsection.location)
containing_section_locs = modulestore().get_parent_locations(containing_subsection.location, None)
containing_section = modulestore().get_item(containing_section_locs[0])
# cdodge hack. We're having trouble previewing drafts via jump_to redirect

View File

@@ -6,7 +6,6 @@ import requests
import time
from datetime import datetime
from xmodule.graders import load_grading_policy
from xmodule.modulestore import Location
from xmodule.seq_module import SequenceDescriptor, SequenceModule
from xmodule.timeparse import parse_time, stringify_time

View File

@@ -160,13 +160,13 @@ class DraftModuleStore(ModuleStoreBase):
return super(DraftModuleStore, self).delete_item(as_draft(location))
def get_parent_locations(self, location):
def get_parent_locations(self, location, course_id):
'''Find all locations that are the parents of this location. Needed
for path_to_location().
returns an iterable of things that can be passed to Location.
'''
return super(DraftModuleStore, self).get_parent_locations(location)
return super(DraftModuleStore, self).get_parent_locations(location, course_id)
def publish(self, location, published_by_id):
"""