From 5fe2e2ed65e41e9bbfdb69c80a817747ab5eb123 Mon Sep 17 00:00:00 2001 From: shufeng2012 <277665039@qq.com> Date: Fri, 24 Jul 2026 16:50:15 +0800 Subject: [PATCH] refix --- dnfs/dnfs.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/dnfs/dnfs.py b/dnfs/dnfs.py index f2ae92a..f8f7718 100755 --- a/dnfs/dnfs.py +++ b/dnfs/dnfs.py @@ -177,19 +177,21 @@ def add_note(): # db.session.commit() - select_payload = { - 'action': 'select', - 'table': 'Notes', - 'where': { - 'id': pid + if pid != 0: + + select_payload = { + 'action': 'select', + 'table': 'Notes', + 'where': { + 'id': pid + } } - } - notes = call_db_service(DB_SERVER_URL, select_payload) + notes = call_db_service(DB_SERVER_URL, select_payload) - # 不存在的父节点 - #if [] == notes['data']: - # return jsonify({'error': 'the new node need a parent'}), 400 + # 不存在的父节点 + if [] == notes['data']: + return jsonify({'error': 'the new node need a parent'}), 400 # 内容审查