From f1201c692b0a831f5b8c77c3078956bde84d8c7e Mon Sep 17 00:00:00 2001 From: shufeng2012 <277665039@qq.com> Date: Fri, 24 Jul 2026 16:42:08 +0800 Subject: [PATCH] prepare fix bug --- dnfs/dnfs.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dnfs/dnfs.py b/dnfs/dnfs.py index 541fc3e..f2ae92a 100755 --- a/dnfs/dnfs.py +++ b/dnfs/dnfs.py @@ -177,6 +177,21 @@ def add_note(): # db.session.commit() + select_payload = { + 'action': 'select', + 'table': 'Notes', + 'where': { + 'id': pid + } + } + + notes = call_db_service(DB_SERVER_URL, select_payload) + + # 不存在的父节点 + #if [] == notes['data']: + # return jsonify({'error': 'the new node need a parent'}), 400 + + # 内容审查 review = review_content(title + '\n\n' + content, 10) if not review: @@ -282,7 +297,7 @@ def delete_note(): notes = call_db_service(DB_SERVER_URL, select_payload) # 有子节点的情况不可删除 - if not notes['data']: + if [] != notes['data']: return jsonify({'error': 'this node has a child'}), 400