Skip to content

Commit

Permalink
style: [AXIMST-629] improve flag naming
Browse files Browse the repository at this point in the history
  • Loading branch information
NiedielnitsevIvan committed Mar 14, 2024
1 parent 1821464 commit 408bb3e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions lms/djangoapps/courseware/toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
f'{WAFFLE_FLAG_NAMESPACE}.disable_navigation_sidebar', __name__
)

# .. toggle_name: courseware.disable_default_open_discussion_sidebar
# .. toggle_name: courseware.disable_default_opening_discussion_sidebar
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Disable opening the discussion sidebar by default on Learning MFE.
Expand All @@ -91,7 +91,7 @@
# .. toggle_tickets: AXIMST-629
# .. toggle_warning: None.
COURSEWARE_MICROFRONTEND_DISCUSSION_SIDEBAR_OPEN_DISABLED = CourseWaffleFlag(
f'{WAFFLE_FLAG_NAMESPACE}.disable_default_open_discussion_sidebar', __name__
f'{WAFFLE_FLAG_NAMESPACE}.disable_default_opening_discussion_sidebar', __name__
)

# .. toggle_name: courseware.mfe_progress_milestones_streak_discount_enabled
Expand Down Expand Up @@ -221,8 +221,8 @@ def courseware_mfe_sidebar_is_disabled(course_key=None):
return COURSEWARE_MICROFRONTEND_SIDEBAR_DISABLED.is_enabled(course_key)


def courseware_mfe_discussion_sidebar_open_is_disabled(course_key=None):
def courseware_mfe_discussion_sidebar_opening_is_disabled(course_key=None):
"""
Return whether the courseware.disable_default_open_discussion_sidebar flag is on.
Return whether the courseware.disable_default_opening_discussion_sidebar flag is on.
"""
return COURSEWARE_MICROFRONTEND_DISCUSSION_SIDEBAR_OPEN_DISABLED.is_enabled(course_key)
6 changes: 3 additions & 3 deletions lms/djangoapps/courseware/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
from lms.djangoapps.courseware.permissions import MASQUERADE_AS_STUDENT, VIEW_COURSE_HOME, VIEW_COURSEWARE
from lms.djangoapps.courseware.toggles import (
course_is_invitation_only,
courseware_mfe_discussion_sidebar_open_is_disabled,
courseware_mfe_discussion_sidebar_opening_is_disabled,
courseware_mfe_search_is_enabled,
courseware_mfe_sidebar_is_disabled,
)
Expand Down Expand Up @@ -2289,12 +2289,12 @@ def courseware_mfe_sidebar_enabled(request, course_id=None):


@api_view(['GET'])
def courseware_mfe_discussion_sidebar_open_is_enabled(request, course_id=None):
def courseware_mfe_discussion_sidebar_opening_is_enabled(request, course_id=None):
"""
Simple GET endpoint to expose whether the course may open discussion sidebar by default.
"""
course_key = CourseKey.from_string(course_id) if course_id else None

return JsonResponse({
"enabled": not courseware_mfe_discussion_sidebar_open_is_disabled(course_key)
"enabled": not courseware_mfe_discussion_sidebar_opening_is_disabled(course_key)
})
2 changes: 1 addition & 1 deletion lms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@
),
re_path(
fr'^courses/{settings.COURSE_ID_PATTERN}/discussion-sidebar/enabled/$',
courseware_views.courseware_mfe_discussion_sidebar_open_is_enabled,
courseware_views.courseware_mfe_discussion_sidebar_opening_is_enabled,
name='discussion_sidebar_enabled_view',
),
]
Expand Down

0 comments on commit 408bb3e

Please sign in to comment.