Merge "Use foundation member IDs in invitations list"

This commit is contained in:
Zuul 2017-11-01 17:29:12 +00:00 committed by Gerrit Code Review
commit ec0908b08c
2 changed files with 4 additions and 10 deletions

View File

@ -27,7 +27,7 @@ from string import Template
class ATC(object): class ATC(object):
def __init__(self, row): def __init__(self, row):
self.lpid = row[0] self.osfid = row[0]
self.name = unicode(row[1], 'utf8') self.name = unicode(row[1], 'utf8')
self.emails = row[2:] self.emails = row[2:]
@ -79,6 +79,6 @@ if __name__ == '__main__':
session.sendmail(settings.EMAIL_FROM, committer.emails, session.sendmail(settings.EMAIL_FROM, committer.emails,
msg.as_string()) msg.as_string())
print "%s,ATC,%s" % (code, committer.name) print "%s,%s,%s" % (code, committer.osfid, committer.name)
session.quit() session.quit()
time.sleep(settings.EMAIL_PAUSE) time.sleep(settings.EMAIL_PAUSE)

View File

@ -628,19 +628,11 @@ def main(argv=sys.argv):
owners[owner]['extra'].sort() owners[owner]['extra'].sort()
# Build the data used for an invite # Build the data used for an invite
invite = []
if 'username' not in owners[owner] or not owners[owner]['username']:
print(
'SKIPPING MALFORMED OWNER: no username found for account %s' %
owner, file=sys.stderr)
continue
invite.append(owners[owner]['username'])
if 'name' not in owners[owner] or not owners[owner]['name']: if 'name' not in owners[owner] or not owners[owner]['name']:
print( print(
'SKIPPING MALFORMED OWNER: no fullname found for account %s' % 'SKIPPING MALFORMED OWNER: no fullname found for account %s' %
owner, file=sys.stderr) owner, file=sys.stderr)
continue continue
invite.append(owners[owner]['name'].encode('utf-8'))
if 'preferred' not in owners[owner]: if 'preferred' not in owners[owner]:
if 'extra' in owners[owner] and owners[owner]['extra']: if 'extra' in owners[owner] and owners[owner]['extra']:
owners[owner]['preferred'] = owners[owner]['extra'][0] owners[owner]['preferred'] = owners[owner]['extra'][0]
@ -658,6 +650,8 @@ def main(argv=sys.argv):
if member['data']: if member['data']:
owners[owner]['member'] = member['data'][0]['id'] owners[owner]['member'] = member['data'][0]['id']
continue continue
invite = [owners[owner].get('member','0')]
invite.append(owners[owner]['name'].encode('utf-8'))
invite.append(owners[owner]['preferred']) invite.append(owners[owner]['preferred'])
invite += owners[owner]['extra'] invite += owners[owner]['extra']
invites.append(invite) invites.append(invite)