Skip to content

Commit 875158f

Browse files
authored
feat!: Put "How It Works" Page Behind Waffle in Preparation for Removal (openedx#36496)
We add a a new Waffle toggle: * legacy_studio.logged_out_home Unless enabled, unauthenticated users accessing Studio will now be sent to the login page, and then redirected to the logged-in Studio home (the course listing). By the Ulmo release, the Waffle will be removed along with the howitworks page, and the new redirect-to-login behavior will become the only available behavior. The howitworks page is implemented as a legacy frontend, and we are not seeing enough value in it to justify a rewrite in React. Via the DEPR process we confirmed that the new behavior is acceptable, or even preferable, as it removes edX.org-oriented language from the community release and reduces the number of clicks needed for Studio users to log in. We add an a new Waffle toggles Part of: openedx#36269 which is part of: openedx#36275
1 parent 8e9f944 commit 875158f

File tree

4 files changed

+34
-5
lines changed

4 files changed

+34
-5
lines changed

cms/djangoapps/contentstore/tests/test_contentstore.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,9 +2164,13 @@ def _test_page(self, page, status_code=200):
21642164
resp = self.client.get_html(page)
21652165
self.assertEqual(resp.status_code, status_code)
21662166

2167-
def test_how_it_works(self):
2167+
@override_waffle_flag(toggles.LEGACY_STUDIO_LOGGED_OUT_HOME, True)
2168+
def test_how_it_works_legacy(self):
21682169
self._test_page("/howitworks")
21692170

2171+
def test_how_it_works_redirect_to_signin(self):
2172+
self._test_page("/howitworks", 302)
2173+
21702174
def test_signup(self):
21712175
# deprecated signup url redirects to LMS register.
21722176
self._test_page("/signup", 301)

cms/djangoapps/contentstore/tests/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def test_inactive_session_timeout(self):
176176
(True, 'assertContains'),
177177
(False, 'assertNotContains'))
178178
@unpack
179+
@override_waffle_flag(toggles.LEGACY_STUDIO_LOGGED_OUT_HOME, True)
179180
def test_signin_and_signup_buttons_index_page(self, allow_account_creation, assertion_method_name):
180181
"""
181182
Navigate to the home page and check the Sign Up button is hidden when ALLOW_PUBLIC_ACCOUNT_CREATION flag

cms/djangoapps/contentstore/toggles.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,3 +637,25 @@ def enable_course_optimizer(course_id):
637637
Returns a boolean if course optimizer is enabled on the course
638638
"""
639639
return ENABLE_COURSE_OPTIMIZER.is_enabled(course_id)
640+
641+
642+
# .. toggle_name: legacy_studio.logged_out_home
643+
# .. toggle_implementation: WaffleFlag
644+
# .. toggle_default: False
645+
# .. toggle_description: Temporarily fall back to the old Studio "How it Works" page when unauthenticated
646+
# .. toggle_use_cases: temporary
647+
# .. toggle_creation_date: 2025-03-14
648+
# .. toggle_target_removal_date: 2025-09-14
649+
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
650+
# .. toggle_warning: In Ulmo, this toggle will be removed, along with the legacy page. The only available
651+
# behavior will be to send the user to the log-in page with a redirect to Studio Course Listing (/home).
652+
LEGACY_STUDIO_LOGGED_OUT_HOME = WaffleFlag('legacy_studio.logged_out_home', __name__)
653+
654+
655+
def use_legacy_logged_out_home():
656+
"""
657+
Returns whether the old "how it works" page should be shown.
658+
659+
If not, then we should just go to the login page w/ redirect to studio course listing.
660+
"""
661+
return LEGACY_STUDIO_LOGGED_OUT_HOME.is_enabled()

cms/djangoapps/contentstore/views/public.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from common.djangoapps.edxmako.shortcuts import render_to_response
1212

1313
from ..config.waffle import ENABLE_ACCESSIBILITY_POLICY_PAGE
14+
from ..toggles import use_legacy_logged_out_home
1415

1516
__all__ = [
1617
'register_redirect_to_lms', 'login_redirect_to_lms', 'howitworks', 'accessibility',
@@ -62,11 +63,12 @@ def _build_next_param(request):
6263

6364

6465
def howitworks(request):
65-
"Proxy view"
66-
if request.user.is_authenticated:
67-
return redirect('/home/')
68-
else:
66+
"""
67+
Deprecated logged-out home page. New behavior is just login w/ redirect to studio course list.
68+
"""
69+
if use_legacy_logged_out_home() and not request.user.is_authenticated:
6970
return render_to_response('howitworks.html', {})
71+
return redirect('/home/')
7072

7173

7274
def accessibility(request):

0 commit comments

Comments
 (0)