'Validate course_id'

def clean_course_id(self):

    value = self.cleaned_data['course_id']
    try:
        return CourseLocator.from_string(value)
    except InvalidKeyError:
        raise ValidationError("'{}'    is    not    a    valid    course    id".format(value))
