|
13 | 13 | from common.djangoapps.student.auth import has_studio_read_access, has_studio_write_access |
14 | 14 | from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin, verify_course_exists, view_auth_classes |
15 | 15 | from ..serializers import CourseTabSerializer, CourseTabUpdateSerializer, TabIDLocatorSerializer |
16 | | -from ....toggles import use_new_custom_pages |
17 | 16 | from ....views.tabs import edit_tab_handler, get_course_tabs, reorder_tabs_handler |
18 | 17 |
|
19 | 18 |
|
@@ -79,24 +78,20 @@ def get(self, request: Request, course_id: str) -> Response: |
79 | 78 | ``` |
80 | 79 | """ |
81 | 80 | course_key = CourseKey.from_string(course_id) |
82 | | - if not use_new_custom_pages(course_key): |
83 | | - return Response(status=status.HTTP_403_FORBIDDEN) |
84 | 81 | if not has_studio_read_access(request.user, course_key): |
85 | 82 | self.permission_denied(request) |
86 | 83 |
|
87 | 84 | course_block = modulestore().get_course(course_key) |
88 | 85 | tabs_to_render = get_course_tabs(course_block, request.user) |
89 | 86 | serializedCourseTabs = CourseTabSerializer(tabs_to_render, many=True).data |
90 | | - if use_new_custom_pages(course_key): |
91 | | - json_tabs = [] |
92 | | - for tab in serializedCourseTabs: |
93 | | - if tab.get('type') == 'static_tab': |
94 | | - url_slug = tab.get('settings').get('url_slug') |
95 | | - static_tab_loc = course_block.id.make_usage_key("static_tab", url_slug) |
96 | | - tab["id"] = str(static_tab_loc) |
97 | | - json_tabs.append(tab) |
98 | | - return Response(json_tabs) |
99 | | - return Response(serializedCourseTabs) |
| 87 | + json_tabs = [] |
| 88 | + for tab in serializedCourseTabs: |
| 89 | + if tab.get('type') == 'static_tab': |
| 90 | + url_slug = tab.get('settings').get('url_slug') |
| 91 | + static_tab_loc = course_block.id.make_usage_key("static_tab", url_slug) |
| 92 | + tab["id"] = str(static_tab_loc) |
| 93 | + json_tabs.append(tab) |
| 94 | + return Response(json_tabs) |
100 | 95 |
|
101 | 96 |
|
102 | 97 | @view_auth_classes(is_authenticated=True) |
|
0 commit comments