Skip to content

Commit

Permalink
Fix deletion of existing tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixellion committed Dec 6, 2022
1 parent 1afe37b commit d2698a4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions icalendar_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ def sync_calendar(calendar_url, tag="todoisttotxt", priority=3):
for item in items['items']:
# print(item)
if ical_uid_stamp in item['description']:
print(f"Exists, delete: {item['content']}")
response = requests.post("https://api.todoist.com/sync/v9/sync", headers=todoist_headers, json={
"commands": [
{
"type": "item_delete",
"uuid": str(uuid4),
"args": {"id": item['id']}
}
]
}
)
print(f"Exists: {item['content']}")
# response = requests.post("https://api.todoist.com/sync/v9/sync", headers=todoist_headers, json={
# "commands": [
# {
# "type": "item_delete",
# "uuid": str(uuid4),
# "args": {"id": item['id']}
# }
# ]
# }
# )
# print(response.text)
existed = item
time.sleep(0.2)
Expand Down

0 comments on commit d2698a4

Please sign in to comment.