def set_password(self, password):
    if (password is None):
        raise ValueError('Empty password not allowed')
    self.password = password
    with db.session.begin():
        db.session.merge(self)
    db.session.refresh(self)
    return self
def set_password(self, password):
    if (password is None):
        raise ValueError('Empty password not allowed')
    self.password = password
    with db.session.begin():
        db.session.merge(self)
    db.session.refresh(self)
    return self