Skip to content

Commit

Permalink
Fixed bulksettings test for rc
Browse files Browse the repository at this point in the history
Fixed bulksettings tests to accomodate changes made from upstream to urls.py,
and compute_publish_state function
  • Loading branch information
sjang92 committed Aug 25, 2014
1 parent 26fbc12 commit a6e6eb1
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def get_settings_dict_for_category(cls, category, child, parent):
settings_dict[setting_type] = value

if category == 'vertical':
settings_dict['ispublic'] = compute_publish_state(child)
settings_dict['ispublic'] = modulestore().compute_publish_state(child)

return settings_dict

Expand All @@ -316,22 +316,17 @@ def get_settings_url_for_category(cls, category, child, parent):
- Chapters: Course url
- Problems: Unit url
"""

if category == "chapter":
return reverse('contentstore.views.course_handler',
kwargs={'course_key_string': unicode(parent.id)})

elif category == "sequential":
return reverse('contentstore.views.subsection_handler',
kwargs={'usage_key_string': unicode(child.location)})

elif category == "unit":
return reverse('contentstore.views.unit_handler',
kwargs={'usage_key_string': unicode(child.location)})
handler = category

if category == "chapter":
usage_key_string = unicode(parent.id)
elif category == "sequential" or category == "unit":
usage_key_string = unicode(child.location)
else:
return reverse('contentstore.views.unit_handler',
kwargs={'usage_key_string': unicode(parent.location)})
usage_key_string = unicode(parent.location)
handler = 'unit'

return reverse('component_handler', kwargs={'usage_key_string': usage_key_string, 'handler': handler})

@classmethod
def get_bulksettings_metadata(cls, course):
Expand Down

0 comments on commit a6e6eb1

Please sign in to comment.