'Check that each course key in list is valid.'

def validate_courses(self, value):

    course_keys = value
    for course in course_keys:
        try:
            CourseKey.from_string(course)
        except InvalidKeyError:
            raise serializers.ValidationError('Course    key    not    valid:    {}'.format(course))
    return value
