Commit cd3544c1 by M. Rehan Committed by GitHub

Merge pull request #9 from edx/mrehan/auto-generated-images

Make course ids available to auto-generated images.
parents e795d07f 73e0285f
......@@ -53,6 +53,8 @@ class CourseSerializer(serializers.ModelSerializer):
class VideoSerializer(serializers.ModelSerializer):
course_ids = serializers.SerializerMethodField(source='get_course_ids', read_only=True)
class Meta:
model = Video
fields = (
......@@ -71,8 +73,12 @@ class VideoSerializer(serializers.ModelSerializer):
'video_trans_end',
'video_trans_status',
'video_glacierid'
'course_ids'
)
def get_course_ids(self, video):
return [course_id.strip() for course_id in video.inst_class.local_storedir.split(',') if course_id]
def create(self, validated_data):
return Video.objects.create(**validated_data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment