From eff582dee4d6cd54aeb3abb5fa990748495b5c66 Mon Sep 17 00:00:00 2001 From: woni <320753691@qq.com> Date: Tue, 16 Apr 2024 17:22:57 +0800 Subject: [PATCH] fix create doc bugs --- app/task.py | 8 ++++---- app/utils/feishu.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/task.py b/app/task.py index 57d3837..f531e80 100644 --- a/app/task.py +++ b/app/task.py @@ -153,12 +153,12 @@ def process_new_demand(app_id, app_secret, table_id, record_id, data): if category == "optRTwYcra": parent_node_token = "SvWCwlWJ8iuFKpkXp1rcd9u2n3c" - doc_node_toke = create_doc(client, space_id, parent_node_token, title) - block_id = get_doc_block(client, doc_node_toke) + doc_node_token, doc_obj_token = create_doc(client, space_id, parent_node_token, title) + block_id = get_doc_block(client, doc_obj_token) - create_doc_block(client, doc_node_toke, block_id, background, features) + create_doc_block(client, doc_obj_token, block_id, background, features) - doc_node_url = f"https://ying-dao.feishu.cn/wiki/{doc_node_toke}" + doc_node_url = f"https://ying-dao.feishu.cn/wiki/{doc_node_token}" update_record( client, bitable_token, table_id, record_id, {"需求文档链接": doc_node_url} diff --git a/app/utils/feishu.py b/app/utils/feishu.py index 38e8351..e60f139 100644 --- a/app/utils/feishu.py +++ b/app/utils/feishu.py @@ -113,7 +113,7 @@ def create_doc(client, space_id, parent_node_token, title): return print(lark.JSON.marshal(response.data)) - return response.data.node.node_token + return response.data.node.node_token, response.data.node.obj_token def get_doc_block(client, document_id): @@ -316,7 +316,7 @@ if __name__ == "__main__": if category == "optRTwYcra": parent_node_token = "F4ivwKrgyiQ4zOkuLVFcTq9Bnee" - doc_id = create_doc(client, space_id, parent_node_token, title) + create_doc(client, space_id, parent_node_token, title) pass