Skip to content

Commit

Permalink
Merge pull request #115 from Stanford-Online/sjang92/bs_fix
Browse files Browse the repository at this point in the history
Fixed bulksettings test for rc
  • Loading branch information
jbau committed Aug 26, 2014
2 parents a0e8606 + a6e6eb1 commit 12bc524
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 12bc524

Please sign in to comment.