'Check and clean the Chilean RUT.'

def clean(self, value):

    super(CLRutField, self).clean(value)
    if (value in EMPTY_VALUES):
        return u''
    (rut, verificador) = self._canonify(value)
    if (self._algorithm(rut) == verificador):
        return self._format(rut, verificador)
    else:
        raise ValidationError(self.error_messages[u'checksum'])
