This commit is contained in:
primetheus 2021-03-22 11:54:04 -04:00
Родитель b82ce6eda9
Коммит e38cbf9fde
2 изменённых файлов: 6 добавлений и 3 удалений

4
app.py
Просмотреть файл

@ -28,9 +28,9 @@ def sync_new_team():
"""
owner = github_app.payload["organization"]["login"]
team_id = github_app.payload["team"]["id"]
if os.environ['USER_DIRECTORY'].upper() == 'AAD':
if os.environ["USER_DIRECTORY"].upper() == "AAD":
## Azure APIs don't currently support case insensitive searching
slug = github_app.payload["team"]["name"].replace(' ', '-')
slug = github_app.payload["team"]["name"].replace(" ", "-")
else:
slug = github_app.payload["team"]["slug"]
client = github_app.installation_client

Просмотреть файл

@ -77,7 +77,10 @@ class AzureAD:
).json()["value"]
for member in members:
user_info = self.get_user_info(token=token, user=member["id"])
user = {"username": user_info[self.USERNAME_ATTRIBUTE], "email": user_info["mail"]}
user = {
"username": user_info[self.USERNAME_ATTRIBUTE],
"email": user_info["mail"],
}
print(user)
member_list.append(user)
return member_list