'Update course modes for an existing course.'

def update(self, instance, validated_data):

    validated_data['modes'] = self._new_course_mode_models(validated_data['modes'])
    instance.update(validated_data)
    instance.save()
    return instance
