def delete(self, node_uuid): tm = TreeManager(NodeTree, db.session) if tm is None: return RetStatus(False, "get manager handle failed. ").dumps_json() del_ret = tm.delete_node(node_uuid=node_uuid) if del_ret.check() is False: return del_ret.dumps_json() return RetStatus(True, "delete node success")
def delete(self, node_uuid): tm = TreeManager(NodeTree, db.session) if tm is None: return ret_msg(status=False, msg="get manager handle failed.") status, node = tm.find_node(node_uuid=node_uuid) if status is False: return ret_msg(status=False, msg=node) if node.is_student: users = node.users for ite in users: ite.delete() status, error = tm.delete_node(node_uuid=node_uuid) if status is False: return ret_msg(status=False, msg=error) return ret_msg(status=True, msg="delete node success.")