I'm using the Github3 library to access the Github Enterprise API. I'm trying to get all organizations a specific user has, but after I got the generator of ShortOrganization, I don't know how to actually get the organization name, can anyone help?
Here is my attempt:
ghe = github3.enterprise_login(url=url, token=access_token)
user = ghe.user('myu')
iter_org = user.organizations()
print(iter_org)
org_list = []
for org_name in iter_org:
org_list.append(org_name.login)
print(org_list)
Below is my current output:
<GitHubIterator [-1, /api/v3/users/myu/orgs]>
[]
Where I did wrong?