serJD commited on
Commit
626eb22
·
1 Parent(s): ace6aed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -61,7 +61,7 @@ def extract_branch_info(stream_id, server_url=None, token=None):
61
  if commits:
62
  latest_commit = commits[0]
63
  branch_data["updated"] = latest_commit.createdAt
64
- branch_data["commit_url"] = f"{server_url}/streams/{stream_id}/commits/{latest_commit.id}"
65
  branch_data["commit_message"] = latest_commit.message
66
  branch_data["author"] = latest_commit.authorName
67
  #except Exception as e:
@@ -93,13 +93,15 @@ def sync_to_notion(token, database_id, branch_data):
93
  "Content-Type": "application/json"
94
  }
95
 
 
 
 
 
 
96
  try:
97
 
98
- # Extract all branch names for the "depends-on" options
99
- branch_names = [branch['Name'] for branch in branch_data]
100
- # Update the "depends-on" multi-select options to match branch names
101
- update_select_options(database_id, headers, branch_names)
102
 
 
103
  # Fetch existing data from Notion database
104
  response = requests.post(f"{base_url}/databases/{database_id}/query", headers=headers)
105
  response.raise_for_status()
 
61
  if commits:
62
  latest_commit = commits[0]
63
  branch_data["updated"] = latest_commit.createdAt
64
+ branch_data["commit_url"] = f"{server_url}streams/{stream_id}/commits/{latest_commit.id}"
65
  branch_data["commit_message"] = latest_commit.message
66
  branch_data["author"] = latest_commit.authorName
67
  #except Exception as e:
 
93
  "Content-Type": "application/json"
94
  }
95
 
96
+ # Extract all branch names for the "depends-on" options
97
+ branch_names = [branch['Name'] for branch in branch_data]
98
+ # Update the "depends-on" multi-select options to match branch names
99
+ update_select_options(database_id, headers, branch_names)
100
+
101
  try:
102
 
 
 
 
 
103
 
104
+
105
  # Fetch existing data from Notion database
106
  response = requests.post(f"{base_url}/databases/{database_id}/query", headers=headers)
107
  response.raise_for_status()