def update(self, instance, validated_data): course_image = validated_data['course_image'] course_image.name = 'course_image.' + IMAGE_TYPES[course_image.content_type] update_course_run_asset(instance.id, course_image) instance.course_image = course_image.name modulestore().update_item(instance, self.context['request'].user.id) return instance
def update(self, instance, validated_data): course_image = validated_data['course_image'] course_image.name = 'course_image.' + IMAGE_TYPES[course_image.content_type] update_course_run_asset(instance.id, course_image) instance.course_image = course_image.name modulestore().update_item(instance, self.context['request'].user.id) return instance