diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index e09ff48834db..39e826b3e4f3 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -2155,7 +2155,7 @@ def test_logout(self): @override_waffle_switch(waffle.ENABLE_ACCESSIBILITY_POLICY_PAGE, active=True) def test_accessibility(self): - self._test_page('/accessibility') + self._test_page('/accessibility', 302) def _create_course(test, course_key, course_data): diff --git a/cms/djangoapps/contentstore/views/checklists.py b/cms/djangoapps/contentstore/views/checklists.py index b5d6abd75847..eb5c651a3da3 100644 --- a/cms/djangoapps/contentstore/views/checklists.py +++ b/cms/djangoapps/contentstore/views/checklists.py @@ -1,35 +1,27 @@ # lint-amnesty, pylint: disable=missing-module-docstring +from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied -from django.views.decorators.csrf import ensure_csrf_cookie +from django.http.response import Http404 +from django.shortcuts import redirect from opaque_keys.edx.keys import CourseKey -from common.djangoapps.edxmako.shortcuts import render_to_response from common.djangoapps.student.auth import has_course_author_access -from cms.djangoapps.contentstore.utils import get_proctored_exam_settings_url -from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order __all__ = ['checklists_handler'] @login_required -@ensure_csrf_cookie def checklists_handler(request, course_key_string=None): ''' The restful handler for course checklists. It allows retrieval of the checklists (as an HTML page). - - GET - html: return an html page which will show course checklists. Note that only the checklists container - is returned and that the actual data is determined with a client-side request. ''' course_key = CourseKey.from_string(course_key_string) if not has_course_author_access(request.user, course_key): raise PermissionDenied() - - course_block = modulestore().get_course(course_key) - return render_to_response('checklists.html', { - 'language_code': request.LANGUAGE_CODE, - 'context_course': course_block, - 'mfe_proctored_exam_settings_url': get_proctored_exam_settings_url(course_block.id), - }) + mfe_base_url = settings.COURSE_AUTHORING_MICROFRONTEND_URL + if mfe_base_url: + studio_checklist_url = f'{mfe_base_url}/course/{course_key_string}/checklists' + return redirect(studio_checklist_url) + raise Http404 diff --git a/cms/djangoapps/contentstore/views/public.py b/cms/djangoapps/contentstore/views/public.py index f4d1f7c77858..71f5ee55126a 100644 --- a/cms/djangoapps/contentstore/views/public.py +++ b/cms/djangoapps/contentstore/views/public.py @@ -74,7 +74,8 @@ def accessibility(request): Display the accessibility accommodation form. """ if ENABLE_ACCESSIBILITY_POLICY_PAGE.is_enabled(): - return render_to_response('accessibility.html', { - 'language_code': request.LANGUAGE_CODE - }) + mfe_base_url = settings.COURSE_AUTHORING_MICROFRONTEND_URL + if mfe_base_url: + studio_accessbility_url = f'{mfe_base_url}/accessibility' + return redirect(studio_accessbility_url) raise Http404