diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 38c73e07cf..a2acd86d4f 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -230,11 +230,10 @@ def container_handler(request, usage_key_string): json: not currently supported """ if 'text/html' in request.META.get('HTTP_ACCEPT', 'text/html'): + usage_key = UsageKey.from_string(usage_key_string) - if not has_course_access(request.user, usage_key.course_key): - raise PermissionDenied() try: - xblock = get_modulestore(usage_key).get_item(usage_key) + course, xblock, __ = _get_item_in_course(request, usage_key) except ItemNotFoundError: return HttpResponseBadRequest() diff --git a/cms/djangoapps/contentstore/views/tests/test_container_page.py b/cms/djangoapps/contentstore/views/tests/test_container_page.py index 108f7d9253..3cb0ceb3b0 100644 --- a/cms/djangoapps/contentstore/views/tests/test_container_page.py +++ b/cms/djangoapps/contentstore/views/tests/test_container_page.py @@ -2,6 +2,7 @@ Unit tests for the container page. """ +import re from contentstore.utils import compute_publish_state, PublishState from contentstore.views.tests.utils import StudioPageTestCase from xmodule.modulestore.django import modulestore @@ -30,19 +31,17 @@ class ContainerPageTestCase(StudioPageTestCase): category="video", display_name="My Video") def test_container_html(self): - branch_name = "MITx.999.Robot_Super_Course/branch/draft/block" self._test_html_content( self.child_container, - branch_name=branch_name, expected_section_tag=( '