Ejemplo n.º 1
0
def full_delete_user(session: DBSession, uid: int):
    db_user = session.get_user_by_id(uid)

    if db_user is None or db_user.is_delete is True:
        raise DBUserNotExistsException

    session.delete(db_user)
Ejemplo n.º 2
0
def full_delete_msg(session: DBSession, msg_id: int):
    db_msg = session.get_msg_by_id(msg_id)
    if db_msg is None or db_msg.is_delete is True:
        raise DBMsgNotExistsException
    session.delete(db_msg)