feat!: Remove the course sock and related APIs.

DEPR: https://github.com/openedx/edx-platform/issues/36429

This change removes the course_sock and related API data.  The UI it
removes is on the Legacy Courseware pages which have also been replaced
and have their own [deprecation ticket](https://github.com/openedx/edx-platform/issues/35803)

Before this can be merged, we will need to update the
frontend-app-learning MFE to no longer consume the
`can_show_upgrade_sock` attribute.

BREAKING CHANGE: CourseHomeMetadata, ProgressTab, OutlineTab and
VerifiedMode APIs will no longer have a `can_show_upgrade_sock`
attribute.
This commit is contained in:
Feanil Patel
2025-03-24 10:35:13 -04:00
parent 94468ef4b3
commit 1829eb7d71
17 changed files with 7 additions and 614 deletions

View File

@@ -31,7 +31,6 @@ from openedx.core.djangoapps.user_api.tests.factories import UserCourseTagFactor
from openedx.features.course_duration_limits.models import CourseDurationLimitConfig
from openedx.features.course_experience import (
COURSE_ENABLE_UNENROLLED_ACCESS_FLAG,
DISPLAY_COURSE_SOCK_FLAG,
ENABLE_COURSE_GOALS
)
from openedx.features.discounts.applicability import (
@@ -362,12 +361,6 @@ class OutlineTabTestViews(BaseCourseHomeTests):
assert (data['access_expiration'] is not None) == show_enrolled
assert (data['resume_course']['url'] is not None) == show_enrolled
@ddt.data(True, False)
def test_can_show_upgrade_sock(self, sock_enabled):
with override_waffle_flag(DISPLAY_COURSE_SOCK_FLAG, active=sock_enabled):
response = self.client.get(self.url)
assert response.data['can_show_upgrade_sock'] == sock_enabled
def test_verified_mode(self):
enrollment = CourseEnrollment.enroll(self.user, self.course.id)
CourseDurationLimitConfig.objects.create(enabled=True, enabled_as_of=datetime(2018, 1, 1))

View File

@@ -9,7 +9,6 @@ from rest_framework import serializers
from lms.djangoapps.courseware.utils import verified_upgrade_deadline_link
from openedx.core.djangoapps.courseware_api.utils import serialize_upgrade_info
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG
from openedx.features.course_experience.utils import dates_banner_should_display
@@ -59,13 +58,8 @@ class VerifiedModeSerializer(ReadOnlySerializer):
Requires 'course_overview', 'enrollment', and 'request' from self.context.
"""
can_show_upgrade_sock = serializers.SerializerMethodField()
verified_mode = serializers.SerializerMethodField()
def get_can_show_upgrade_sock(self, _):
course_overview = self.context['course_overview']
return DISPLAY_COURSE_SOCK_FLAG.is_enabled(course_overview.id)
def get_verified_mode(self, _):
"""Return verified mode information, or None."""
course_overview = self.context['course_overview']

View File

@@ -341,7 +341,7 @@ class IndexQueryTestCase(ModuleStoreTestCase):
self.client.login(username=self.user.username, password=self.user_password)
CourseEnrollment.enroll(self.user, course.id)
with self.assertNumQueries(154, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST):
with self.assertNumQueries(152, table_ignorelist=QUERY_COUNT_TABLE_IGNORELIST):
with check_mongo_calls(3):
url = reverse(
'courseware_section',

View File

@@ -48,7 +48,6 @@ from openedx.features.course_experience import (
default_course_url
)
from openedx.features.course_experience.url_helpers import make_learning_mfe_courseware_url
from openedx.features.course_experience.views.course_sock import CourseSockFragmentView
from openedx.features.enterprise_support.api import data_sharing_consent_required
from ..access import has_access
@@ -454,9 +453,6 @@ class CoursewareIndex(View):
table_of_contents['chapters'],
)
courseware_context['course_sock_fragment'] = CourseSockFragmentView().render_to_fragment(
request, course=self.course)
# entrance exam data
self._add_entrance_exam_to_context(courseware_context)