Skip to content

Commit f0c13b2

Browse files
committed
fix: issues
1 parent 49fe3d1 commit f0c13b2

5 files changed

Lines changed: 21 additions & 7 deletions

File tree

lms/djangoapps/course_home_api/dates/views.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from lms.djangoapps.courseware.courses import get_course_date_blocks
2020
from lms.djangoapps.courseware.date_summary import TodaysDate
2121
from lms.djangoapps.courseware.masquerade import setup_masquerade
22+
from lms.djangoapps.courseware.tabs import DatesTab
2223
from openedx.core.lib.api.authentication import BearerAuthenticationAllowInactiveUser
2324
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
2425

@@ -110,13 +111,19 @@ def get(self, request, *args, **kwargs):
110111
course_key=course_key,
111112
)
112113

114+
course_date_blocks = (
115+
[block for block in blocks if not isinstance(block, TodaysDate)]
116+
if DatesTab.is_enabled(course, request.user)
117+
else []
118+
)
119+
113120
# User locale settings
114121
user_timezone_locale = user_timezone_locale_prefs(request)
115122
user_timezone = user_timezone_locale['user_timezone']
116123

117124
data = {
118125
'has_ended': course.has_ended(),
119-
'course_date_blocks': [block for block in blocks if not isinstance(block, TodaysDate)],
126+
'course_date_blocks': course_date_blocks,
120127
'learner_is_full_access': learner_is_full_access,
121128
'user_timezone': user_timezone,
122129
}

lms/djangoapps/course_home_api/outline/views.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from lms.djangoapps.courseware.courses import get_course_date_blocks, get_course_info_section
4343
from lms.djangoapps.courseware.date_summary import TodaysDate
4444
from lms.djangoapps.courseware.masquerade import is_masquerading, setup_masquerade
45+
from lms.djangoapps.courseware.tabs import DatesTab
4546
from lms.djangoapps.courseware.toggles import courseware_disable_navigation_sidebar_blocks_caching
4647
from lms.djangoapps.courseware.views.views import get_cert_data
4748
from lms.djangoapps.grades.course_grade_factory import CourseGradeFactory
@@ -249,7 +250,12 @@ def get(self, request, *args, **kwargs): # pylint: disable=too-many-statements
249250
if show_enrolled:
250251
course_blocks = get_course_outline_block_tree(request, course_key_string, request.user)
251252
date_blocks = get_course_date_blocks(course, request.user, request, num_assignments=1)
252-
dates_widget['course_date_blocks'] = [block for block in date_blocks if not isinstance(block, TodaysDate)]
253+
course_date_blocks = (
254+
[block for block in date_blocks if not isinstance(block, TodaysDate)]
255+
if DatesTab.is_enabled(course, request.user)
256+
else []
257+
)
258+
dates_widget['course_date_blocks'] = course_date_blocks
253259

254260
handouts_html = get_course_info_section(request, request.user, course, 'handouts')
255261
welcome_message_html = get_current_update_for_user(request, course)

lms/djangoapps/courseware/plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def is_available(cls, course_key: CourseKey) -> bool: # pylint: disable=unused-
8080
"""
8181
Dates app is available when explicitly enabled via settings.
8282
"""
83-
return settings.FEATURES.get("ENABLE_DATES_COURSE_APP", False)
83+
return settings.ENABLE_DATES_COURSE_APP
8484

8585
@classmethod
8686
def is_enabled(cls, course_key: CourseKey) -> bool:

lms/envs/common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,14 +2783,14 @@
27832783
# .. setting_description: Content to replace spam posts with
27842784
CONTENT_FOR_SPAM_POSTS = ""
27852785

2786-
# .. toggle_name: settings.FEATURES['ENABLE_DATES_COURSE_APP']
2786+
# .. toggle_name: ENABLE_DATES_COURSE_APP
27872787
# .. toggle_implementation: DjangoSetting
27882788
# .. toggle_default: False
27892789
# .. toggle_description: Controls whether the Dates course app is surfaced via the course apps API/UI.
27902790
# .. toggle_use_cases: open_edx
2791-
# .. toggle_creation_date: 2026-01-21
2792-
# .. toggle_tickets: None
2793-
FEATURES['ENABLE_DATES_COURSE_APP'] = False
2791+
# .. toggle_creation_date: 2026-02-02
2792+
# .. toggle_tickets: https://github.com/openedx/platform-roadmap/issues/392
2793+
ENABLE_DATES_COURSE_APP = False
27942794

27952795
# .. toggle_name: ENABLE_AUTHN_RESET_PASSWORD_HIBP_POLICY
27962796
# .. toggle_implementation: DjangoSetting

openedx/static/paragon/*

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../node_modules/@edx/paragon/themeable/*

0 commit comments

Comments
 (0)