feat: add course language to courseware API (#34392)

This commit is contained in:
Nathan Sprenkle
2024-03-20 11:02:41 -04:00
committed by GitHub
parent 02dc68221b
commit 8571eeca61
2 changed files with 6 additions and 0 deletions

View File

@@ -91,6 +91,7 @@ class CourseInfoSerializer(serializers.Serializer): # pylint: disable=abstract-
entrance_exam_data = serializers.DictField()
id = serializers.CharField() # pylint: disable=invalid-name
license = serializers.CharField()
language = serializers.CharField(allow_null=True)
media = _CourseApiMediaCollectionSerializer(source='*')
name = serializers.CharField(source='display_name_with_default_escaped')
offer = serializers.DictField()

View File

@@ -134,6 +134,10 @@ class CoursewareMeta:
def license(self):
return self.course.license
@property
def language(self):
return self.course.language
@property
def notes(self):
"""
@@ -418,6 +422,7 @@ class CoursewareInformation(RetrieveAPIView):
* entrance_exam_passed: (bool) Indicates if the entrance exam has been passed
* id: A unique identifier of the course; a serialized representation
of the opaque key identifying the course.
* language: The language code for the course
* media: An object that contains named media items. Included here:
* course_image: An image to show for the course. Represented
as an object with the following fields: