Skip to content

Commit

Permalink
team: naively look for emails in all users (#494)
Browse files Browse the repository at this point in the history
Temporary workaround for #493 - we pretend each user attached to a GitHub ID might be legitimate.
  • Loading branch information
bobheadxi authored Sep 25, 2020
1 parent 2bf9cbd commit b9cb544
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/controller/command/commands/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,13 @@ def refresh_drive_permissions(self, t: Team):
users = self.facade. \
query(User, [('github_user_id', github_id)])
if len(users) != 1:
logging.error(f"None/multiple users for GitHub ID {github_id}")
continue
user = users[0]
if len(user.email) > 0:
emails.append(user.email)
logging.warn(f"None/multiple users for GitHub ID {github_id}")

# For now, naiively iterate over all users, due to
# https://github.com/ubclaunchpad/rocket2/issues/493
for user in users:
if len(user.email) > 0:
emails.append(user.email)

# Sync permissions
if len(emails) > 0:
Expand Down

0 comments on commit b9cb544

Please sign in to comment.