From 13a70fcaa64428fd564e912aa370a96ce9ee3316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Mon, 26 Oct 2020 19:46:05 +0100 Subject: [PATCH] Deprecate COURSE_OUTLINE_PAGE_FLAG and UNIFIED_COURSE_TAB_FLAG These flags are deprecated in favor or the DISABLE_* equivalent. This allows us to get rid of the DefaultTrueWaffleNamespace class. --- common/test/db_fixtures/waffle_flags.json | 4 +- lms/djangoapps/courseware/tabs.py | 10 +-- .../courseware/tests/test_course_info.py | 14 ++-- .../courseware/tests/test_date_summary.py | 12 +-- .../courseware/tests/test_entrance_exam.py | 6 +- .../courseware/tests/test_masquerade.py | 6 +- .../courseware/tests/test_navigation.py | 6 +- lms/djangoapps/courseware/tests/test_tabs.py | 8 +- lms/djangoapps/courseware/tests/test_views.py | 20 ++--- lms/djangoapps/courseware/views/index.py | 4 +- lms/djangoapps/courseware/views/views.py | 4 +- lms/envs/common.py | 2 +- lms/templates/courseware/courseware.html | 4 +- .../features/course_experience/__init__.py | 80 +++---------------- openedx/features/course_experience/plugins.py | 4 +- .../course-home-fragment.html | 4 +- .../tests/views/test_course_home.py | 9 +-- 17 files changed, 70 insertions(+), 127 deletions(-) diff --git a/common/test/db_fixtures/waffle_flags.json b/common/test/db_fixtures/waffle_flags.json index b2f6f7228b..f586c5832b 100644 --- a/common/test/db_fixtures/waffle_flags.json +++ b/common/test/db_fixtures/waffle_flags.json @@ -3,8 +3,8 @@ "pk": 1, "model": "waffle.flag", "fields": { - "name": "course_experience.course_outline_page", - "everyone": false + "name": "course_experience.disable_course_outline_page", + "everyone": true } }, { diff --git a/lms/djangoapps/courseware/tabs.py b/lms/djangoapps/courseware/tabs.py index e5a4e5f3cf..e97fc92069 100644 --- a/lms/djangoapps/courseware/tabs.py +++ b/lms/djangoapps/courseware/tabs.py @@ -14,7 +14,7 @@ from lms.djangoapps.courseware.entrance_exams import user_can_skip_entrance_exam from lms.djangoapps.course_home_api.toggles import course_home_mfe_dates_tab_is_active, course_home_mfe_outline_tab_is_active from lms.djangoapps.course_home_api.utils import get_microfrontend_url from openedx.core.lib.course_tabs import CourseTabPluginManager -from openedx.features.course_experience import RELATIVE_DATES_FLAG, UNIFIED_COURSE_TAB_FLAG, default_course_url_name +from openedx.features.course_experience import RELATIVE_DATES_FLAG, DISABLE_UNIFIED_COURSE_TAB_FLAG, default_course_url_name from student.models import CourseEnrollment from xmodule.tabs import CourseTab, CourseTabList, course_reverse_func_from_name_func, key_checker @@ -58,10 +58,10 @@ class CoursewareTab(EnrolledTab): """ Returns true if this tab is enabled. """ + if DISABLE_UNIFIED_COURSE_TAB_FLAG.is_enabled(course.id): + return super(CoursewareTab, cls).is_enabled(course, user) # If this is the unified course tab then it is always enabled - if UNIFIED_COURSE_TAB_FLAG.is_enabled(course.id): - return True - return super(CoursewareTab, cls).is_enabled(course, user) + return True class CourseInfoTab(CourseTab): @@ -360,7 +360,7 @@ def get_course_tab_list(user, course): continue tab.name = _("Entrance Exam") # TODO: LEARNER-611 - once the course_info tab is removed, remove this code - if UNIFIED_COURSE_TAB_FLAG.is_enabled(course.id) and tab.type == 'course_info': + if not DISABLE_UNIFIED_COURSE_TAB_FLAG.is_enabled(course.id) and tab.type == 'course_info': continue if tab.type == 'static_tab' and tab.course_staff_only and \ not bool(user and has_access(user, 'staff', course, course.id)): diff --git a/lms/djangoapps/courseware/tests/test_course_info.py b/lms/djangoapps/courseware/tests/test_course_info.py index 578cd8b7dc..925b9a6f96 100644 --- a/lms/djangoapps/courseware/tests/test_course_info.py +++ b/lms/djangoapps/courseware/tests/test_course_info.py @@ -22,7 +22,7 @@ from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration from openedx.core.djangoapps.site_configuration.tests.test_util import with_site_configuration_context from openedx.core.djangoapps.waffle_utils.testutils import WAFFLE_TABLES, override_waffle_flag from openedx.features.content_type_gating.models import ContentTypeGatingConfig -from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG +from openedx.features.course_experience import DISABLE_UNIFIED_COURSE_TAB_FLAG from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseTestConsentRequired from student.models import CourseEnrollment from student.tests.factories import AdminFactory @@ -42,7 +42,7 @@ from .helpers import LoginEnrollmentTestCase QUERY_COUNT_TABLE_BLACKLIST = WAFFLE_TABLES -@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) +@override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) class CourseInfoTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCase, SharedModuleStoreTestCase): """ Tests for the Course Info page @@ -154,7 +154,7 @@ class CourseInfoTestCase(EnterpriseTestConsentRequired, LoginEnrollmentTestCase, self.assertEqual(response.status_code, 404) -@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) +@override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) class CourseInfoLastAccessedTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): """ Tests of the CourseInfo last accessed link. @@ -222,7 +222,7 @@ class CourseInfoLastAccessedTestCase(LoginEnrollmentTestCase, ModuleStoreTestCas self.assertEqual(resume_course_url, section_url) -@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) +@override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) @ddt.ddt class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): """ @@ -314,7 +314,7 @@ class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): ) -@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) +@override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) class CourseInfoTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase): """ Test for unenrolled student tries to access ccx. @@ -351,7 +351,7 @@ class CourseInfoTestCaseCCX(SharedModuleStoreTestCase, LoginEnrollmentTestCase): self.assertRedirects(response, expected, status_code=302, target_status_code=200) -@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) +@override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase): """ Tests for the Course Info page for an XML course @@ -398,7 +398,7 @@ class CourseInfoTestCaseXML(LoginEnrollmentTestCase, ModuleStoreTestCase): @override_settings(FEATURES=dict(settings.FEATURES, EMBARGO=False)) -@override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) +@override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) class SelfPacedCourseInfoTestCase(LoginEnrollmentTestCase, SharedModuleStoreTestCase): """ Tests for the info page of self-paced courses. diff --git a/lms/djangoapps/courseware/tests/test_date_summary.py b/lms/djangoapps/courseware/tests/test_date_summary.py index 8bb5685d72..b50181e1fd 100644 --- a/lms/djangoapps/courseware/tests/test_date_summary.py +++ b/lms/djangoapps/courseware/tests/test_date_summary.py @@ -44,7 +44,7 @@ from openedx.core.djangoapps.user_api.preferences.api import set_user_preference from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag from openedx.features.course_duration_limits.models import CourseDurationLimitConfig from openedx.features.course_experience import ( - RELATIVE_DATES_FLAG, UNIFIED_COURSE_TAB_FLAG, UPGRADE_DEADLINE_MESSAGE, CourseHomeMessages + RELATIVE_DATES_FLAG, DISABLE_UNIFIED_COURSE_TAB_FLAG, UPGRADE_DEADLINE_MESSAGE, CourseHomeMessages ) from student.tests.factories import TEST_PASSWORD, CourseEnrollmentFactory, UserFactory from xmodule.modulestore import ModuleStoreEnum @@ -420,7 +420,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): 'info', 'openedx.course_experience.course_home', ) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=False) def test_todays_date_no_timezone(self, url_name): with freeze_time('2015-01-02'): course = create_course_run() @@ -442,7 +442,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): 'info', 'openedx.course_experience.course_home', ) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=False) def test_todays_date_timezone(self, url_name): with freeze_time('2015-01-02'): course = create_course_run() @@ -472,7 +472,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): 'info', 'openedx.course_experience.course_home', ) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=False) def test_start_date_render(self, url_name): with freeze_time('2015-01-02'): course = create_course_run() @@ -490,7 +490,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): 'info', 'openedx.course_experience.course_home', ) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=False) def test_start_date_render_time_zone(self, url_name): with freeze_time('2015-01-02'): course = create_course_run() @@ -732,7 +732,7 @@ class CourseDateSummaryTest(SharedModuleStoreTestCase): ('openedx.course_experience.course_home', False), ) @ddt.unpack - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=False) @RELATIVE_DATES_FLAG.override(active=True) def test_dates_tab_link_render(self, url_name, mfe_active): """ The dates tab link should only show for enrolled or staff users """ diff --git a/lms/djangoapps/courseware/tests/test_entrance_exam.py b/lms/djangoapps/courseware/tests/test_entrance_exam.py index 77f14037bb..aa091d8d86 100644 --- a/lms/djangoapps/courseware/tests/test_entrance_exam.py +++ b/lms/djangoapps/courseware/tests/test_entrance_exam.py @@ -22,7 +22,7 @@ from lms.djangoapps.courseware.tests.factories import InstructorFactory, Request from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag from openedx.core.djangolib.testing.utils import get_mock_request -from openedx.features.course_experience import COURSE_OUTLINE_PAGE_FLAG, UNIFIED_COURSE_TAB_FLAG +from openedx.features.course_experience import DISABLE_COURSE_OUTLINE_PAGE_FLAG, DISABLE_UNIFIED_COURSE_TAB_FLAG from student.models import CourseEnrollment from student.tests.factories import AnonymousUserFactory, CourseEnrollmentFactory from util.milestones_helpers import ( @@ -357,7 +357,7 @@ class EntranceExamTestCases(LoginEnrollmentTestCase, ModuleStoreTestCase, Milest self.assertNotContains(resp, 'You have passed the entrance exam.') # TODO: LEARNER-71: Do we need to adjust or remove this test? - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_entrance_exam_passed_message_and_course_content(self): """ Unit Test: exam passing message and rest of the course section should be present @@ -456,7 +456,7 @@ class EntranceExamTestCases(LoginEnrollmentTestCase, ModuleStoreTestCase, Milest }) self.assertRedirects(response, expected_url, status_code=302, target_status_code=200) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) def test_courseinfo_page_access_without_passing_entrance_exam(self): """ Test courseware access page without passing entrance exam diff --git a/lms/djangoapps/courseware/tests/test_masquerade.py b/lms/djangoapps/courseware/tests/test_masquerade.py index bd4a8437ad..cbb6d81eaf 100644 --- a/lms/djangoapps/courseware/tests/test_masquerade.py +++ b/lms/djangoapps/courseware/tests/test_masquerade.py @@ -28,7 +28,7 @@ from openedx.core.djangoapps.lang_pref import LANGUAGE_KEY from openedx.core.djangoapps.self_paced.models import SelfPacedConfiguration from openedx.core.djangoapps.user_api.preferences.api import get_user_preference, set_user_preference from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag -from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG +from openedx.features.course_experience import DISABLE_UNIFIED_COURSE_TAB_FLAG from student.models import CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulestore.django import modulestore @@ -299,7 +299,7 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi self.client.cookies[settings.LANGUAGE_COOKIE].value, expected_language_code ) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) def test_masquerade_as_specific_user_on_self_paced(self): """ @@ -390,7 +390,7 @@ class TestStaffMasqueradeAsSpecificStudent(StaffMasqueradeTestCase, ProblemSubmi self.get_courseware_page() self.assertExpectedLanguageInPreference(self.test_user, english_language_code) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) @patch.dict('django.conf.settings.FEATURES', {'DISABLE_START_DATES': False}) def test_masquerade_as_specific_student_course_info(self): """ diff --git a/lms/djangoapps/courseware/tests/test_navigation.py b/lms/djangoapps/courseware/tests/test_navigation.py index 1dcd931b84..d9b1b55bcc 100644 --- a/lms/djangoapps/courseware/tests/test_navigation.py +++ b/lms/djangoapps/courseware/tests/test_navigation.py @@ -15,7 +15,7 @@ from six.moves import range from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag -from openedx.features.course_experience import COURSE_OUTLINE_PAGE_FLAG +from openedx.features.course_experience import DISABLE_COURSE_OUTLINE_PAGE_FLAG from student.tests.factories import UserFactory from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase @@ -99,7 +99,7 @@ class TestNavigation(SharedModuleStoreTestCase, LoginEnrollmentTestCase): return # TODO: LEARNER-71: Do we need to adjust or remove this test? - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_chrome_settings(self): ''' Test settings for disabling and modifying navigation chrome in the courseware: @@ -228,7 +228,7 @@ class TestNavigation(SharedModuleStoreTestCase, LoginEnrollmentTestCase): self.assertRedirects(resp, section_url) # TODO: LEARNER-71: Do we need to adjust or remove this test? - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_incomplete_course(self): email = self.staff_user.email password = "test" diff --git a/lms/djangoapps/courseware/tests/test_tabs.py b/lms/djangoapps/courseware/tests/test_tabs.py index d6328f3020..94f67f4669 100644 --- a/lms/djangoapps/courseware/tests/test_tabs.py +++ b/lms/djangoapps/courseware/tests/test_tabs.py @@ -28,7 +28,7 @@ from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase from lms.djangoapps.courseware.views.views import StaticCourseTabView, get_static_tab_fragment from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag from openedx.core.djangolib.testing.utils import get_mock_request -from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG +from openedx.features.course_experience import DISABLE_UNIFIED_COURSE_TAB_FLAG from student.models import CourseEnrollment from student.tests.factories import UserFactory from util.milestones_helpers import ( @@ -774,7 +774,7 @@ class CourseInfoTabTestCase(TabTestCase): self.user = self.create_mock_user() self.addCleanup(set_current_request, None) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) def test_default_tab(self): # Verify that the course info tab is the first tab tabs = get_course_tab_list(self.user, self.course) @@ -785,14 +785,14 @@ class CourseInfoTabTestCase(TabTestCase): # as part of the linked ticket self.assertEqual(tabs[1].type, 'course_info') - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=False) def test_default_tab_for_new_course_experience(self): # Verify that the unified course experience hides the course info tab tabs = get_course_tab_list(self.user, self.course) self.assertEqual(tabs[0].type, 'courseware') # TODO: LEARNER-611 - remove once course_info is removed. - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=True) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=False) def test_default_tab_for_displayable(self): tabs = xmodule_tabs.CourseTabList.iterate_displayable(self.course, self.user) for i, tab in enumerate(tabs): diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index ad07f86650..7efadb0c29 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -81,9 +81,9 @@ from openedx.features.content_type_gating.models import ContentTypeGatingConfig from openedx.features.course_duration_limits.models import CourseDurationLimitConfig from openedx.features.course_experience import ( COURSE_ENABLE_UNENROLLED_ACCESS_FLAG, - COURSE_OUTLINE_PAGE_FLAG, - RELATIVE_DATES_FLAG, - UNIFIED_COURSE_TAB_FLAG + DISABLE_COURSE_OUTLINE_PAGE_FLAG, + DISABLE_UNIFIED_COURSE_TAB_FLAG, + RELATIVE_DATES_FLAG ) from openedx.features.course_experience.tests.views.helpers import add_course_mode from openedx.features.enterprise_support.tests.mixins.enterprise import EnterpriseTestConsentRequired @@ -903,7 +903,7 @@ class ViewsTestCase(BaseViewsTestCase): response = self.client.get(url) self.assertRedirects(response, reverse('signin_user') + '?next=' + url) - @override_waffle_flag(UNIFIED_COURSE_TAB_FLAG, active=False) + @override_waffle_flag(DISABLE_UNIFIED_COURSE_TAB_FLAG, active=True) def test_bypass_course_info(self): course_id = six.text_type(self.course_key) @@ -917,7 +917,7 @@ class ViewsTestCase(BaseViewsTestCase): self.assertEqual(response.status_code, 200) # TODO: TNL-6387: Remove test - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_accordion(self): """ This needs a response_context, which is not included in the render_accordion's main method @@ -1083,27 +1083,27 @@ class TestAccordionDueDate(BaseDueDateTests): ) # TODO: LEARNER-71: Delete entire TestAccordionDueDate class - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_backwards_compatibility(self): super(TestAccordionDueDate, self).test_backwards_compatibility() # TODO: LEARNER-71: Delete entire TestAccordionDueDate class - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_defaults(self): super(TestAccordionDueDate, self).test_defaults() # TODO: LEARNER-71: Delete entire TestAccordionDueDate class - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_format_date(self): super(TestAccordionDueDate, self).test_format_date() # TODO: LEARNER-71: Delete entire TestAccordionDueDate class - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_format_invalid(self): super(TestAccordionDueDate, self).test_format_invalid() # TODO: LEARNER-71: Delete entire TestAccordionDueDate class - @override_waffle_flag(COURSE_OUTLINE_PAGE_FLAG, active=False) + @override_waffle_flag(DISABLE_COURSE_OUTLINE_PAGE_FLAG, active=True) def test_format_none(self): super(TestAccordionDueDate, self).test_format_none() diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index 63de82313e..5dac77e8d5 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -40,7 +40,7 @@ from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace from openedx.core.djangolib.markup import HTML, Text from openedx.features.course_experience import ( COURSE_ENABLE_UNENROLLED_ACCESS_FLAG, - COURSE_OUTLINE_PAGE_FLAG, + DISABLE_COURSE_OUTLINE_PAGE_FLAG, default_course_url_name, RELATIVE_DATES_FLAG, ) @@ -454,7 +454,7 @@ class CoursewareIndex(View): 'disable_optimizely': not WaffleSwitchNamespace('RET').is_enabled('enable_optimizely_in_courseware'), 'section_title': None, 'sequence_title': None, - 'disable_accordion': COURSE_OUTLINE_PAGE_FLAG.is_enabled(self.course.id), + 'disable_accordion': not DISABLE_COURSE_OUTLINE_PAGE_FLAG.is_enabled(self.course.id), 'show_search': show_search, } courseware_context.update( diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index 6baab743f0..dc91709b7a 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -111,7 +111,7 @@ from openedx.core.djangolib.markup import HTML, Text from openedx.core.lib.mobile_utils import is_request_from_mobile_app from openedx.features.content_type_gating.models import ContentTypeGatingConfig from openedx.features.course_duration_limits.access import generate_course_expired_fragment -from openedx.features.course_experience import UNIFIED_COURSE_TAB_FLAG, course_home_url_name +from openedx.features.course_experience import DISABLE_UNIFIED_COURSE_TAB_FLAG, course_home_url_name from openedx.features.course_experience.course_tools import CourseToolsPluginManager from openedx.features.course_experience.utils import dates_banner_should_display from openedx.features.course_experience.views.course_dates import CourseDatesFragmentView @@ -443,7 +443,7 @@ def course_info(request, course_id): course_key = CourseKey.from_string(course_id) # If the unified course experience is enabled, redirect to the "Course" tab - if UNIFIED_COURSE_TAB_FLAG.is_enabled(course_key): + if not DISABLE_UNIFIED_COURSE_TAB_FLAG.is_enabled(course_key): return redirect(reverse(course_home_url_name(course_key), args=[course_id])) with modulestore().bulk_operations(course_key): diff --git a/lms/envs/common.py b/lms/envs/common.py index 548306dd8b..9e7b368a73 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -369,7 +369,7 @@ FEATURES = { # .. toggle_default: True # .. toggle_description: When enabled, along with the ENABLE_MKTG_SITE feature toggle, users who attempt to access a # course "about" page will be redirected to the course home url. This url might be the course "info" page or the - # unified course tab (when the UNIFIED_COURSE_TAB_FLAG waffle is enabled). + # unified course tab (when the DISABLE_UNIFIED_COURSE_TAB_FLAG waffle is not enabled). # .. toggle_use_cases: open_edx # .. toggle_creation_date: 2019-01-15 # .. toggle_tickets: https://github.com/edx/edx-platform/pull/19604 diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index 2bf97f0273..2e53b5611a 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -13,7 +13,7 @@ from django.utils.translation import ugettext as _ from lms.djangoapps.edxnotes.helpers import is_feature_enabled as is_edxnotes_enabled from openedx.core.djangolib.js_utils import js_escaped_string from openedx.core.djangolib.markup import HTML -from openedx.features.course_experience import course_home_page_title, COURSE_OUTLINE_PAGE_FLAG +from openedx.features.course_experience import course_home_page_title, DISABLE_COURSE_OUTLINE_PAGE_FLAG %> <% include_special_exams = ( @@ -177,7 +177,7 @@ ${HTML(fragment.foot_html())}