adjust event data
continuous-integration/drone/push Build is passing

This commit is contained in:
jianxin committed 2024-04-10 14:18:15 +08:00
1 parent 4faa3f07ab
commit 27ff70ba57
2 files changed
+298 -85

No files matched your search

+6 -5
View File
@@ -79,7 +79,7 @@ def do_bitable_record_add(data) -> None:
table_id = event.get("table_id")
action_list = event.get("action_list")
actions_name = [action.get("action") for action in action_list]
actions_name = [action.get("action") for action in action_list]
target_actions = ["record_edited", "record_added"]
@@ -87,7 +87,7 @@ def do_bitable_record_add(data) -> None:
action for action in action_list if action.get("action") == "record_edited"
]
if not( set(target_actions) <= set(actions_name)):
if not (set(target_actions) <= set(actions_name)):
return
if table_id != "tblESHsFZwtiFROB":
@@ -103,14 +103,15 @@ def do_bitable_record_add(data) -> None:
action_data = {}
for field in after_value:
tmp = "".join([item["text"] for item in json.loads(field.get("field_value"))])
if field.get("field_id") == "fldIV2G9lv":
action_data["title"] = field.get("field_value")
action_data["title"] = tmp
if field.get("field_id") == "fldk5ImODy":
action_data["background"] = field.get("field_value")
action_data["background"] = tmp
if field.get("field_id") == "fldfjXnFVa":
action_data["features"] = field.get("field_value")
action_data["features"] = tmp
print(f"table_id: {table_id}")
print(f"record_id: {record_id}")