Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cms/djangoapps/contentstore/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ def get_course_settings(request, course_key, course_block):
publisher_enabled = configuration_helpers.get_value_for_org(
course_block.location.org,
'ENABLE_PUBLISHER',
settings.FEATURES.get('ENABLE_PUBLISHER', False)
settings.ENABLE_PUBLISHER
)
marketing_enabled = configuration_helpers.get_value_for_org(
course_block.location.org,
Expand All @@ -1395,15 +1395,15 @@ def get_course_settings(request, course_key, course_block):
enable_extended_course_details = configuration_helpers.get_value_for_org(
course_block.location.org,
'ENABLE_EXTENDED_COURSE_DETAILS',
settings.FEATURES.get('ENABLE_EXTENDED_COURSE_DETAILS', False)
settings.ENABLE_EXTENDED_COURSE_DETAILS
)

about_page_editable = not publisher_enabled
enrollment_end_editable = GlobalStaff().has_user(request.user) or not publisher_enabled
short_description_editable = configuration_helpers.get_value_for_org(
course_block.location.org,
'EDITABLE_SHORT_DESCRIPTION',
settings.FEATURES.get('EDITABLE_SHORT_DESCRIPTION', True)
settings.EDITABLE_SHORT_DESCRIPTION
)
sidebar_html_enabled = ENABLE_COURSE_ABOUT_SIDEBAR_HTML.is_enabled()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ def create_xblock_info( # pylint: disable=too-many-statements
"user_partitions": user_partitions,
"show_correctness": xblock.show_correctness,
"hide_from_toc": xblock.hide_from_toc,
"enable_hide_from_toc_ui": settings.FEATURES.get("ENABLE_HIDE_FROM_TOC_UI", False),
"enable_hide_from_toc_ui": settings.ENABLE_HIDE_FROM_TOC_UI,
"xblock_type": get_icon(xblock),
}
)
Expand Down
11 changes: 11 additions & 0 deletions cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@
# .. toggle_tickets: https://github.com/openedx/edx-platform/pull/2334
EDITABLE_SHORT_DESCRIPTION = True

# .. toggle_name: settings.ENABLE_EXTENDED_COURSE_DETAILS
# .. toggle_implementation: DjangoSetting
# .. toggle_default: False
# .. toggle_description: When enabled, exposes the extended course detail fields (course background image,
# video thumbnail image, and related text fields) on the Schedule & Details page in Open edX Studio.
# Can also be overridden per-org via site configuration.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2016-04-30
# .. toggle_tickets: WL-398
ENABLE_EXTENDED_COURSE_DETAILS = False

# Hide any Personally Identifiable Information from application logs
SQUELCH_PII_IN_LOGS = False

Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/branding/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ def _footer_mobile_links(is_secure):
platform_name = configuration_helpers.get_value('platform_name', settings.PLATFORM_NAME)

mobile_links = []
if settings.FEATURES.get('ENABLE_FOOTER_MOBILE_APP_LINKS'):
if settings.ENABLE_FOOTER_MOBILE_APP_LINKS:
mobile_links = [
{
"name": "apple",
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/branding/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_footer_content_types(self, theme, accepts, content_type, content):
assert resp['Content-Type'] == content_type
self.assertContains(resp, content)

@mock.patch.dict(settings.FEATURES, {'ENABLE_FOOTER_MOBILE_APP_LINKS': True})
@override_settings(ENABLE_FOOTER_MOBILE_APP_LINKS=True)
def test_footer_json(self):
self._set_feature_flag(True)
with with_comprehensive_theme_context(None):
Expand Down
7 changes: 2 additions & 5 deletions lms/djangoapps/courseware/course_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,13 @@ def is_enabled(cls, request, course_key):
Show this link for active courses where financial assistance is available, unless upgrade deadline has passed
"""
now = datetime.datetime.now(pytz.UTC)
feature_flags = None
try:
course_overview = CourseOverview.objects.get(id=course_key)
except CourseOverview.DoesNotExist:
course_overview = None

# hide link if there's no ENABLE_FINANCIAL_ASSISTANCE_FORM setting (ex: Edge) or if it's False
subset_name = 'FEATURES'
feature_flags = getattr(settings, subset_name)
if feature_flags is None or not feature_flags.get('ENABLE_FINANCIAL_ASSISTANCE_FORM'):
# hide link if financial assistance is not enabled
if not settings.ENABLE_FINANCIAL_ASSISTANCE_FORM:
return False

# hide link for archived courses
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/courseware/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ def course_about(request, course_id): # pylint: disable=too-many-statements
'studio_url': studio_url,
'registered': registered,
'course_target': course_target,
'is_cosmetic_price_enabled': settings.FEATURES.get('ENABLE_COSMETIC_DISPLAY_PRICE'),
'is_cosmetic_price_enabled': settings.ENABLE_COSMETIC_DISPLAY_PRICE,
'course_price': course_price,
'ecommerce_checkout': ecommerce_checkout,
'ecommerce_checkout_link': ecommerce_checkout_link,
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/views/instructor_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def _section_send_email(course, access):
'list_email_content', kwargs={'course_id': str(course_key)}
),
}
if settings.FEATURES.get("ENABLE_NEW_BULK_EMAIL_EXPERIENCE", False) is not False:
if settings.ENABLE_NEW_BULK_EMAIL_EXPERIENCE is not False:
section_data[
"communications_mfe_url"
] = f"{settings.COMMUNICATIONS_MICROFRONTEND_URL}/courses/{str(course_key)}/bulk_email"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"""


from unittest.mock import patch

from django.test import TestCase
from django.test import TestCase, override_settings

from common.djangoapps.student.tests.factories import UserFactory
from common.djangoapps.util.testing import UrlResetMixin
Expand All @@ -21,7 +19,7 @@ class SoftwareSecureFakeViewTest(UrlResetMixin, TestCase):

def setUp(self, **kwargs):
enable_software_secure_fake = kwargs.get('enable_software_secure_fake', False)
with patch.dict('django.conf.settings.FEATURES', {'ENABLE_SOFTWARE_SECURE_FAKE': enable_software_secure_fake}):
with override_settings(ENABLE_SOFTWARE_SECURE_FAKE=enable_software_secure_fake):
super().setUp()

self.user = UserFactory.create(username="test", password="test")
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/verify_student/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
]

# Fake response page for incourse reverification ( software secure )
if settings.FEATURES.get('ENABLE_SOFTWARE_SECURE_FAKE'):
if settings.ENABLE_SOFTWARE_SECURE_FAKE:
from lms.djangoapps.verify_student.tests.fake_software_secure import SoftwareSecureFakeView
urlpatterns += [
path('software-secure-fake-response', SoftwareSecureFakeView.as_view()),
Expand Down
10 changes: 10 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,16 @@
# .. toggle_warning: The use case of this feature toggle is uncertain.
ENABLE_COSMETIC_DISPLAY_PRICE = False

# .. toggle_name: settings.ENABLE_FINANCIAL_ASSISTANCE_FORM
# .. toggle_implementation: DjangoSetting
# .. toggle_default: False
# .. toggle_description: When enabled, exposes the financial assistance application form and its URL route,
# and shows the "financial assistance" course tool link for eligible learners.
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2015-12-04
# .. toggle_tickets: ECOM-2824
ENABLE_FINANCIAL_ASSISTANCE_FORM = False

# Automatically approve student identity verification attempts
# .. toggle_name: settings.AUTOMATIC_VERIFY_STUDENT_IDENTITY_FOR_TESTING
# .. toggle_implementation: DjangoSetting
Expand Down
2 changes: 1 addition & 1 deletion lms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@
path('__debug__/', include(debug_toolbar.urls)),
]

if settings.FEATURES.get('ENABLE_FINANCIAL_ASSISTANCE_FORM'):
if settings.ENABLE_FINANCIAL_ASSISTANCE_FORM:
urlpatterns += [
path(
'financial-assistance/',
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/video_config/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def available_translations(
"""
translations = []
if verify_assets is None:
verify_assets = not settings.FEATURES.get('FALLBACK_TO_ENGLISH_TRANSCRIPTS')
verify_assets = not settings.FALLBACK_TO_ENGLISH_TRANSCRIPTS

sub, other_langs = transcripts["sub"], transcripts["transcripts"]

Expand Down
10 changes: 3 additions & 7 deletions xmodule/tests/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -899,9 +899,7 @@ def test_export_to_xml_unicode_characters(self):


@ddt.ddt
@patch.object(settings, 'FEATURES', create=True, new={
'FALLBACK_TO_ENGLISH_TRANSCRIPTS': False,
})
@patch.object(settings, 'FALLBACK_TO_ENGLISH_TRANSCRIPTS', False)
class VideoBlockStudentViewDataTestCase(unittest.TestCase):
"""
Make sure that VideoBlock returns the expected student_view_data.
Expand Down Expand Up @@ -1023,10 +1021,8 @@ def test_student_view_data_with_hls_flag(self, mock_get_video_info, mock_get_vid
}
}
})
@patch.object(settings, 'FEATURES', create=True, new={
# The default value in {lms,cms}/envs/common.py and xmodule/tests/test_video.py should be consistent.
'FALLBACK_TO_ENGLISH_TRANSCRIPTS': True,
})
# The default value in openedx/envs/common.py and xmodule/tests/test_video.py should be consistent.
@patch.object(settings, 'FALLBACK_TO_ENGLISH_TRANSCRIPTS', True)
class VideoBlockIndexingTestCase(unittest.TestCase):
"""
Make sure that VideoBlock can format data for indexing as expected.
Expand Down
Loading