feat: add course language to courseware API (#34392)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user