'Ensure a valid `usage_key` was provided.'

def clean_usage_key(self):

    usage_key = self.cleaned_data['usage_key']
    try:
        usage_key = UsageKey.from_string(usage_key)
    except InvalidKeyError:
        raise ValidationError("'{}'    is    not    a    valid    usage    key.".format(unicode(usage_key)))
    return usage_key.replace(course_key=modulestore().fill_in_run(usage_key.course_key))
