'Set user password to the digest of `cleartext`.'

def set_password_cleartext(self, cleartext):

    if User.use_pbkdf2:
        self.password = galaxy.security.passwords.hash_password(cleartext)
    else:
        self.password = new_secure_hash(text_type=cleartext)
    self.last_password_change = datetime.now()
