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"]
|
suggested_for_today = props["Suggested for today"]["date"]["start"]
|
||||||
|
|
||||||
project_names = []
|
project_names = []
|
||||||
|
is_personal_project = False
|
||||||
if props["Project"]["relation"]:
|
if props["Project"]["relation"]:
|
||||||
for rel in props["Project"]["relation"]:
|
for rel in props["Project"]["relation"]:
|
||||||
try:
|
try:
|
||||||
project = notion.pages.retrieve(page_id=rel["id"])
|
project = notion.pages.retrieve(page_id=rel["id"])
|
||||||
project_name = project["properties"]["Name"]["title"][0]["plain_text"]
|
project_name = project["properties"]["Name"]["title"][0]["plain_text"]
|
||||||
project_names.append(project_name)
|
project_names.append(project_name)
|
||||||
|
project_type = project["properties"]["Type"]["select"]
|
||||||
|
if project_type and project_type["name"] == "Personal":
|
||||||
|
is_personal_project = True
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
if is_personal_project:
|
||||||
|
continue
|
||||||
|
|
||||||
has_blocking = len(props["Blocking"]["relation"]) > 0 if props["Blocking"]["relation"] else False
|
has_blocking = len(props["Blocking"]["relation"]) > 0 if props["Blocking"]["relation"] else False
|
||||||
|
|
||||||
tasks.append({
|
tasks.append({
|
||||||
|
|||||||
Reference in New Issue
Block a user