Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emergency fix findalias #121

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions odins_spear/scripts/find_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ def main(api, service_provider_id: str, group_id: str, alias: str):
for broadwork_entity in tqdm(broadwork_entities_user_ids, desc="Fetching AA, HG, and CC details"):
# add some buffer time for odins api

formatted = {}
formatted["type"] = broadwork_entity[0]

formatted = {
"type":broadwork_entity[0],
"service_user_id":broadwork_entity[1]
}

temp_object = ""

try:
Expand Down Expand Up @@ -111,11 +113,7 @@ def main(api, service_provider_id: str, group_id: str, alias: str):
for broadwork_entity in tqdm(OBJECT_WITH_ALIAS, desc=f"Searching AA, HG, and CC for alias {alias}"):

if locate_alias(alias, broadwork_entity['aliases']):
return {
"alias":alias,
"service_user_id": broadwork_entity[1],
"type":broadwork_entity[0]
}
return broadwork_entity

users = api.get.users(service_provider_id, group_id, extended=True)
print("Fetched users.")
Expand All @@ -124,9 +122,9 @@ def main(api, service_provider_id: str, group_id: str, alias: str):

if locate_alias(alias, user['aliases']):
return {
"alias": alias,
"type": "user",
"user_id": user['userId'],
"type": "user"
"alias": alias
}

return OSAliasNotFound