sbywater/django-asana

KeyError : workspace_id

Closed this issue · 4 comments

File "D:\PyPro\djangoProject2\venv\lib\site-packages\djasana\management\commands\sync_from_asana.py", line 388, in _sync_workspace_id
if self.client.options['workspace_id'] != workspace_id:
KeyError: 'workspace_id'

That line of code does not exist in the most current version of this project. Please update to the latest version (which is a year old) and try again.

@sbywater - First off, thanks for developing this.

I'm getting a similar error as the OP using v1.4.6:

  File "/Users/dol/.pyenv/versions/pm-tools/lib/python3.9/site-packages/djasana/management/commands/sync_from_asana.py", line 381, in _sync_workspace_id
    if workspace_id != self.client.options['workspace_id']:
KeyError: 'workspace_id'

I wonder if the issue is that my Asana account is a Premium account, and I don't see any mention of Workspaces in my account. We only have Teams and then Projects beneath those. If your project doesn't currently support this use case, I might be able to help with a PR. Or if I'm just not making the right CLI calls, let me know. Thanks!

@pydolan Thank you for reporting this. According to Asana documentation "All projects, tasks, and teams have an associated workspace" so we should support your use case in the sync_from_asana command. Feel free to submit a pull request; if so, please include test coverage.

I am able to duplicate this, and have patched it.