From f2c56fec8d291c73fe4fe133d426296a8e65aab5 Mon Sep 17 00:00:00 2001 From: CHOPP3D <64507146+Chopped4Life@users.noreply.github.com> Date: Wed, 30 Oct 2024 09:25:23 +0000 Subject: [PATCH] Update user_association.py (#129) Co-authored-by: Jordan Prescott --- odins_spear/scripts/user_association.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/odins_spear/scripts/user_association.py b/odins_spear/scripts/user_association.py index 5bbe73d..6a0f572 100644 --- a/odins_spear/scripts/user_association.py +++ b/odins_spear/scripts/user_association.py @@ -42,7 +42,10 @@ def main(api, service_provider_id: str, group_id: str, user_id: str): USER_DATA["aliases"] = user["aliases"] pick_up_group = api.get.call_pickup_group_user(service_provider_id, group_id, user_id) - USER_DATA["pickUpGroup"] = pick_up_group[0]["name"] + try: + USER_DATA["pickUpGroup"] = pick_up_group[0]["name"] + except IndexError: + USER_DATA["pickUpGroup"] = None hunt_groups = api.get.group_hunt_group_user(service_provider_id, group_id, user_id) for hg in tqdm(hunt_groups, desc="Fetching Hunt Groups"):