Skip to content
This repository was archived by the owner on Aug 10, 2019. It is now read-only.
This repository was archived by the owner on Aug 10, 2019. It is now read-only.

API Issue? Key error accessing 'last_updated'  #4

@xtraeme-xt

Description

@xtraeme-xt

http://todoist.com/Support/show/69610/

The script was was working two or so days ago before the big update, but now nextaction.py fails when it tries to look up the 'last_updated' key from the API.

Relevant lines:

response = GetResponse(args.api_token)
#Result of: urllib2.urlopen(urllib2.Request('https://api.todoist.com/TodoistSync/v5.3/get', data)) with {api_token, seq_no: 0} urllib.urlencoded().
initial_data = response.read()
initial_data = json.loads(initial_data)
a = TodoistData(initial_data)
.
.
# TodoistData(object): 
# def __init__(self, initial data):
.
.
for project in initial_data['Projects']:
     if project['is_deleted'] == 0:
          self._projects[project['id']] = Project(project)

# Inside the Project(object) 
# __init__(self, initial_data):
.
.
self.last_updated = initial_data['last_updated']

This line throws a KeyError: on 'last_updated'.

Any ideas on what the issue is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions