Skip to content

TypeError: list indices must be integers or slices, not str #20

@tobes64

Description

@tobes64

Whilst running the GitHub Organizer came across an issue for the update_repository_settings function within the githuborganizer/tasks/github.py file

2022-01-28 16:51:12,955: INFO/ForkPoolWorker-72] JSON was returned
[2022-01-28 16:51:12,957: INFO/ForkPoolWorker-72] Task githuborganizer.tasks.github.update_repository_settings[140d0010-007c-46c5-9824-0f30e0c5df1d] succeeded in 1.4389273878186941s: None
[2022-01-28 16:51:12,958: WARNING/ForkPoolWorker-72] Updating the dependency security settings of repository concat/test.
[2022-01-28 16:51:12,976: ERROR/ForkPoolWorker-67] Task githuborganizer.tasks.github.update_organization_teams[c96d1ae8-47cf-49fd-8c8d-efb430ab1ba3] raised unexpected: TypeError('list indices must be integers or slices, not str',)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 412, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/celery/app/trace.py", line 704, in __protected_call__
    return self.run(*args, **kwargs)
  File "/app/githuborganizer/tasks/github.py", line 137, in update_organization_teams
    repo_permissions = gh.team_has_repositories(org.client.app, ghteam)
  File "/app/githuborganizer/models/gh.py", line 49, in team_has_repositories
    repositories[repo['name']] = []
TypeError: list indices must be integers or slices, not str
[2022-01-28 16:51:12,997: INFO/ForkPoolWorker-71] JSON was returned

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions