From de7123f48e5bc1b75280b44fa0514f96aeb3d943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Alm=C3=A9n?= <78877636+almenscorner@users.noreply.github.com> Date: Wed, 20 Mar 2024 11:26:02 +0100 Subject: [PATCH] only get account id if profile is found --- src/IntuneCD/update/Intune/AppleEnrollmentProfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IntuneCD/update/Intune/AppleEnrollmentProfile.py b/src/IntuneCD/update/Intune/AppleEnrollmentProfile.py index fe5f3cb7..123a7ea7 100644 --- a/src/IntuneCD/update/Intune/AppleEnrollmentProfile.py +++ b/src/IntuneCD/update/Intune/AppleEnrollmentProfile.py @@ -40,13 +40,13 @@ def _get_profile_item_and_account_id( tuple[dict, str]: The profile item and account ID of the Apple Enrollment Profile """ profile_item = None + account_id = None for profile in profile_data: if profile["displayName"] == repo_data["displayName"]: profile_item = profile + account_id = profile_item["id"].split("_")[0] break - account_id = profile_item["id"].split("_")[0] - if not account_id or not profile_item: return None, None