'Convert unicode to a usage key.'

def to_internal_value(self, data):

    try:
        return UsageKey.from_string(data)
    except InvalidKeyError as ex:
        raise serializers.ValidationError('Invalid    usage    key:    {msg}'.format(msg=ex.msg))
