improved evening task fetch with python script
This commit is contained in:
@@ -52,15 +52,22 @@ def get_evening_tasks():
|
||||
suggested_for_today = props["Suggested for today"]["date"]["start"]
|
||||
|
||||
project_names = []
|
||||
is_personal_project = False
|
||||
if props["Project"]["relation"]:
|
||||
for rel in props["Project"]["relation"]:
|
||||
try:
|
||||
project = notion.pages.retrieve(page_id=rel["id"])
|
||||
project_name = project["properties"]["Name"]["title"][0]["plain_text"]
|
||||
project_names.append(project_name)
|
||||
project_type = project["properties"]["Type"]["select"]
|
||||
if project_type and project_type["name"] == "Personal":
|
||||
is_personal_project = True
|
||||
except:
|
||||
pass
|
||||
|
||||
if is_personal_project:
|
||||
continue
|
||||
|
||||
has_blocking = len(props["Blocking"]["relation"]) > 0 if props["Blocking"]["relation"] else False
|
||||
|
||||
tasks.append({
|
||||
|
||||
Reference in New Issue
Block a user