TNL-7185: clean up unused html blobs from the API

Now that the MFE consumes our data structure for a couple of the
alerts, we no longer need to send raw html at all for them.
This commit is contained in:
Michael Terry
2020-12-14 14:26:10 -05:00
parent 2711fbb376
commit cf2e778b56
5 changed files with 8 additions and 31 deletions

View File

@@ -81,7 +81,6 @@ class CourseInfoSerializer(serializers.Serializer): # pylint: disable=abstract-
access_expiration = serializers.DictField()
can_show_upgrade_sock = serializers.BooleanField()
content_type_gating_enabled = serializers.BooleanField()
course_expired_message = serializers.CharField()
effort = serializers.CharField()
end = serializers.DateTimeField()
enrollment = serializers.DictField()
@@ -93,7 +92,6 @@ class CourseInfoSerializer(serializers.Serializer): # pylint: disable=abstract-
name = serializers.CharField(source='display_name_with_default_escaped')
number = serializers.CharField(source='display_number_with_default')
offer = serializers.DictField()
offer_html = serializers.CharField()
org = serializers.CharField(source='display_org_with_default')
related_programs = CourseProgramSerializer(many=True)
short_description = serializers.CharField()

View File

@@ -40,8 +40,8 @@ from openedx.core.lib.api.view_utils import DeveloperErrorViewMixin
from openedx.core.djangoapps.programs.utils import ProgramProgressMeter
from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG
from openedx.features.content_type_gating.models import ContentTypeGatingConfig
from openedx.features.course_duration_limits.access import generate_course_expired_message, get_access_expiration_data
from openedx.features.discounts.utils import generate_offer_data, generate_offer_html
from openedx.features.course_duration_limits.access import get_access_expiration_data
from openedx.features.discounts.utils import generate_offer_data
from common.djangoapps.student.models import (
CourseEnrollment, CourseEnrollmentCelebration, LinkedInAddToProfileConfiguration
)
@@ -123,20 +123,10 @@ class CoursewareMeta:
def access_expiration(self):
return get_access_expiration_data(self.effective_user, self.overview)
@property
def course_expired_message(self):
# TODO: TNL-7185 Legacy: Refactor to return the expiration date and format the message in the MFE
return generate_course_expired_message(self.effective_user, self.overview)
@property
def offer(self):
return generate_offer_data(self.effective_user, self.overview)
@property
def offer_html(self):
# TODO: TNL-7185 Legacy: Refactor to return the offer data and format the message in the MFE
return generate_offer_html(self.effective_user, self.overview)
@property
def content_type_gating_enabled(self):
return ContentTypeGatingConfig.enabled_for_enrollment(