github/copy_members: simplify checking invitations

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2023-01-25 17:17:33 +01:00
parent aedd1176f6
commit b8d3179a6c
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 1 additions and 3 deletions

View File

@ -34,15 +34,13 @@ def main():
in_org = g.get_organization(opts.input_org)
out_org = g.get_organization(opts.output_org)
invitations = [i.login for i in out_org.invitations()]
for team in in_org.get_teams():
print(' --- Team: %s' % team.slug)
if opts.teams is None or team.name in opts.teams or team.slug in opts.teams:
for member in team.get_members():
if out_org.has_in_members(member):
print('%s already a member' % member.login)
elif member.login in invitations:
elif member.login in [i.login for i in out_org.invitations()]:
print('%s already invited' % member.login)
else:
if not opts.dry_run: