Read fields from spec
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2023-08-24 22:46:45 +03:00
parent d3809d568c
commit 7027c06cff

View File

@ -37,8 +37,8 @@ def get_users_inner():
for item in ret["items"]:
username = item['metadata']['name']
display_name = item.get("spec", {}).get("customProfile", {}).get("name", None)
slack_id = item.get("status", {}).get("slackId", None)
user_type = item.get("status", {}).get("type", None)
slack_id = item.get("spec", {}).get("slackId", None)
user_type = item.get("spec", {}).get("type", None)
groups = []
for group in item.get("status", {}).get("groups", []):
groups.append(f"{group['prefix']}:{group['name']}")