From b9cb54477a5682ecbb39f3f1eeedad33f27f1187 Mon Sep 17 00:00:00 2001 From: Robert Lin Date: Fri, 25 Sep 2020 14:28:34 +0800 Subject: [PATCH] team: naively look for emails in all users (#494) Temporary workaround for #493 - we pretend each user attached to a GitHub ID might be legitimate. --- app/controller/command/commands/team.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/controller/command/commands/team.py b/app/controller/command/commands/team.py index 3b7d28c0..6def3a2e 100644 --- a/app/controller/command/commands/team.py +++ b/app/controller/command/commands/team.py @@ -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: