def __setattr__(self, *args, **kwargs):
        if args[0] == 'password':
            password = args[1]
            salt = None

            if password not in (None, ''):
                password, salt = self.hash_password(password)

            self.salt = salt
            args = ('password', password)

        super(User, self).__setattr__(*args, **kwargs)
dataset/ETHPy150Open tooxie/shiva-server/shiva/models.py/User.__setattr__/original