forked from openedx/edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add toggle to allow redirecting to courseware after enrollment.
This change adds a new waffle switch to redirect a student to coursware after enrolment instead of the dashboard.
- Loading branch information
Showing
3 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
Toggles for Dashboard page. | ||
""" | ||
from edx_toggles.toggles import WaffleSwitch | ||
|
||
# Namespace for student waffle flags. | ||
WAFFLE_FLAG_NAMESPACE = 'student' | ||
|
||
# Waffle flag to enable control redirecting after enrolment. | ||
# .. toggle_name: student.redirect_to_courseware_after_enrollment | ||
# .. toggle_implementation: WaffleSwitch | ||
# .. toggle_default: False | ||
# .. toggle_description: Redirect to courseware after enrollment instead of dashboard. | ||
# .. toggle_use_cases: open_edx | ||
# .. toggle_creation_date: 2023-02-06 | ||
# .. toggle_target_removal_date: None | ||
# .. toggle_warning: None | ||
REDIRECT_TO_COURSEWARE_AFTER_ENROLLMENT = WaffleSwitch( | ||
f'{WAFFLE_FLAG_NAMESPACE}.redirect_to_courseware_after_enrollment', __name__ | ||
) | ||
|
||
|
||
def should_redirect_to_courseware_after_enrollment(): | ||
return REDIRECT_TO_COURSEWARE_AFTER_ENROLLMENT.is_enabled() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters