Doist / todoist-python

DEPRECATED The official Todoist Python API library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to update/remove due dates

bluefroguk1 opened this issue · comments

I'm having an issue where i'm unable to update/remove due dates.

I've successfully created tasks and add Due dates. But not able to update or remove due dates from tasks.

import todoist
api = todoist.TodoistAPI('xxxx')
api.reset_state
api.sync()
TaskList = api.state['items']
item = api.items.get_by_id('4061696598')
item.update(due=None)
api.commit
api.sync()
print('done')

I've tried:

due=None
due=null
due=""
due={}

What am i missing?!

It looks like you're not committing the change. api.commit should be api.commit(); this should get the above code snippet working. item.update(due=None) is the correct way to remove a due date.

in this case, item is just a simple dict with the item properties.
To change your task you can do the following:

import todoist
api = todoist.TodoistAPI('xxxx')
api.items.update(4061696598, due=None)
api.commit()

I'm closing this one, please reopen if you see any issue.