Skip to content
Merged
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
11 changes: 6 additions & 5 deletions cms/djangoapps/contentstore/tests/test_contentstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -2142,12 +2142,13 @@ def _test_page(self, page, status_code=200):
resp = self.client.get_html(page)
self.assertEqual(resp.status_code, status_code) # noqa: PT009

@override_waffle_flag(toggles.LEGACY_STUDIO_LOGGED_OUT_HOME, True)
def test_how_it_works_legacy(self):
self._test_page("/howitworks")
def test_homepage_redirects_to_home(self):
# Root URL permanently redirects to studio home (sign-in page).
self._test_page("/", 301)

def test_how_it_works_redirect_to_signin(self):
self._test_page("/howitworks", 302)
def test_howitworks_redirects_to_home(self):
# Legacy landing page permanently redirects; preserves bookmarks.
self._test_page("/howitworks", 301)

def test_signup(self):
# deprecated signup url redirects to LMS register.
Expand Down
29 changes: 1 addition & 28 deletions cms/djangoapps/contentstore/tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@

import datetime
import time
from unittest import mock
from urllib.parse import quote_plus, unquote
from urllib.parse import unquote

from ddt import data, ddt, unpack
from django.conf import settings
Expand Down Expand Up @@ -179,32 +178,6 @@ def test_inactive_session_timeout(self):
# re-request, and we should get a redirect to login page
self.assertRedirects(resp, settings.LOGIN_URL + '?next=/home/', target_status_code=302)

@data(
(True, 'assertContains'),
(False, 'assertNotContains'))
@unpack
@override_waffle_flag(toggles.LEGACY_STUDIO_LOGGED_OUT_HOME, True)
def test_signin_and_signup_buttons_index_page(self, allow_account_creation, assertion_method_name):
"""
Navigate to the home page and check the Sign Up button is hidden when ALLOW_PUBLIC_ACCOUNT_CREATION flag
is turned off, and not when it is turned on. The Sign In button should always appear.
"""
with mock.patch.dict(settings.FEATURES, {"ALLOW_PUBLIC_ACCOUNT_CREATION": allow_account_creation}):
response = self.client.get(reverse('homepage'))
assertion_method = getattr(self, assertion_method_name)
login_url = quote_plus(f"http://testserver{settings.LOGIN_URL}")
assertion_method(
response,
f'<a class="action action-signup" href="{settings.LMS_ROOT_URL}/register'
f'?next={login_url}">Sign Up</a>'
)
self.assertContains(
response,
'<a class="action action-signin" href="/login/?next=http%3A%2F%2Ftestserver%2F">'
'Sign In</a>'
)


class ForumTestCase(CourseTestCase):
"""Tests class to verify course to forum operations"""

Expand Down
22 changes: 0 additions & 22 deletions cms/djangoapps/contentstore/toggles.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,28 +519,6 @@ def enable_course_optimizer(course_id):
return ENABLE_COURSE_OPTIMIZER.is_enabled(course_id)


# .. toggle_name: legacy_studio.logged_out_home
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Temporarily fall back to the old Studio "How it Works" page when unauthenticated
# .. toggle_use_cases: temporary
# .. toggle_creation_date: 2025-03-14
# .. toggle_target_removal_date: 2025-09-14
# .. toggle_tickets: https://github.com/openedx/edx-platform/issues/36275
# .. toggle_warning: In Ulmo, this toggle will be removed, along with the legacy page. The only available
# behavior will be to send the user to the log-in page with a redirect to Studio Course Listing (/home).
LEGACY_STUDIO_LOGGED_OUT_HOME = WaffleFlag('legacy_studio.logged_out_home', __name__)


def use_legacy_logged_out_home():
"""
Returns whether the old "how it works" page should be shown.

If not, then we should just go to the login page w/ redirect to studio course listing.
"""
return LEGACY_STUDIO_LOGGED_OUT_HOME.is_enabled()


# .. toggle_name: contentstore.enable_course_optimizer_check_prev_run_links
# .. toggle_implementation: CourseWaffleFlag
# .. toggle_default: False
Expand Down
14 changes: 1 addition & 13 deletions cms/djangoapps/contentstore/views/public.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
from django.http.response import Http404
from django.shortcuts import redirect

from common.djangoapps.edxmako.shortcuts import render_to_response

from ..config.waffle import ENABLE_ACCESSIBILITY_POLICY_PAGE
from ..toggles import use_legacy_logged_out_home

__all__ = [
'register_redirect_to_lms', 'login_redirect_to_lms', 'howitworks', 'accessibility',
'register_redirect_to_lms', 'login_redirect_to_lms', 'accessibility',
'redirect_to_lms_login_for_admin',
]

Expand Down Expand Up @@ -62,15 +59,6 @@ def _build_next_param(request):
return ''


def howitworks(request):
"""
Deprecated logged-out home page. New behavior is just login w/ redirect to studio course list.
"""
if use_legacy_logged_out_home() and not request.user.is_authenticated:
return render_to_response('howitworks.html', {})
return redirect('/home/')


def accessibility(request):
"""
Display the accessibility accommodation form.
Expand Down
Binary file removed cms/static/images/hiw-feature1.png
Binary file not shown.
Binary file removed cms/static/images/hiw-feature2.png
Binary file not shown.
Binary file removed cms/static/images/hiw-feature3.png
Binary file not shown.
Binary file removed cms/static/images/thumb-hiw-feature1.png
Binary file not shown.
Binary file removed cms/static/images/thumb-hiw-feature2.png
Binary file not shown.
Binary file removed cms/static/images/thumb-hiw-feature3.png
Binary file not shown.
1 change: 0 additions & 1 deletion cms/static/sass/_build-v1.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
@import 'views/updates';
@import 'views/dashboard';
@import 'views/export';
@import 'views/index';
@import 'views/course-create';
@import 'views/import';
@import 'views/outline';
Expand Down
1 change: 0 additions & 1 deletion cms/static/sass/elements/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@
// STATE: active/current nav states

.nav-item.is-current,
body.howitworks .nav-not-signedin-hiw,
body.dashboard .nav-account-dashboard,
body.course.view-outline .nav-course-courseware .title,
body.course.view-updates .nav-course-courseware .title,
Expand Down
Loading
Loading