diff --git a/Scripts/API_Tests/antho-knowledgestate-fix.py b/Scripts/API_Tests/antho-knowledgestate-fix.py index a8618c50..66de0e4b 100644 --- a/Scripts/API_Tests/antho-knowledgestate-fix.py +++ b/Scripts/API_Tests/antho-knowledgestate-fix.py @@ -13,7 +13,7 @@ HEADERS = { KNOWLEDGEGROUPS = [ ] -KNOWLEDGEPROPS = "Anthology Academic Economics: Essential, Anthology Academic Economics: Enhanced, Anthology Accreditation: Essential, Anthology Accreditation: Enhanced, Anthology 101: Essential, Anthology Baseline: Essential, Anthology Baseline: Enhanced, Anthology Beacon: Essential, Anthology Course Evaluations: Essential, Anthology Course Evaluations: Enhanced, Anthology Digital Assistant: Essential, Anthology Digital Assistant: Enhanced, Anthology Encompass: Essential, Anthology Encompass: Enhanced, Anthology Encompass: Enhanced+, Anthology Engage: Essential, Anthology Engage: Enhanced, Anthology Engage: Enhanced+, Anthology Evaluate: Essential, Anthology Evaluate: Enhanced, Anthology Finance & HCM: Essential, Anthology Finance & HCM: Enhanced, Anthology Finance & HCM: Enhanced+, Anthology Insight: Essential, Anthology Insight: Enhanced, Blackboard Learn: Essential, Anthology Milestone: Essential, Anthology Milestone: Enhanced, Outcomes: Essential, Outcomes: Enhanced, Anthology Payroll: Essential, Anthology Payroll: Enhanced, Anthology Planning: Essential, Anthology Planning: Enhanced, Anthology Portfolio: Essential, Anthology Portfolio: Enhanced, Power BI: Essential, Power BI: Enhanced, Anthology Program Review: Essential, Anthology Program Review: Enhanced, Anthology Raise: Essential, Anthology Raise: Enhanced, Anthology Raise: Enhanced+, Anthology Reach: Essential, Anthology Reach: Enhanced, Anthology Reach: Enhanced+, Anthology Student: Essential, Anthology Student: Enhanced" +KNOWLEDGEPROPS = "Anthology Academic Economics: Essential, Anthology Academic Economics: Enhanced, Anthology Accreditation: Essential, Anthology Accreditation: Enhanced, Anthology 101: Essential, Anthology Baseline: Essential, Anthology Baseline: Enhanced, Anthology Beacon: Essential, Anthology Course Evaluations: Essential, Anthology Course Evaluations: Enhanced, Anthology Digital Assistant: Essential, Anthology Digital Assistant: Enhanced, Anthology Encompass: Essential, Anthology Encompass: Enhanced, Anthology Encompass: Enhanced+, Anthology Engage: Essential, Anthology Engage: Enhanced, Anthology Engage: Enhanced+, Anthology Evaluate: Essential, Anthology Evaluate: Enhanced, Anthology Finance & HCM: Essential, Anthology Finance & HCM: Enhanced, Anthology Finance & HCM: Enhanced+, Anthology Insight: Essential, Anthology Insight: Enhanced, Blackboard Learn: Essential, Anthology Milestone: Essential, Anthology Milestone: Enhanced, Outcomes: Essential, Outcomes: Enhanced, Anthology Payroll: Essential, Anthology Payroll: Enhanced, Anthology Planning: Essential, Anthology Planning: Enhanced, Anthology Portfolio: Essential, Anthology Portfolio: Enhanced, Power BI: Essential, Power BI: Enhanced, Anthology Program Review: Essential, Anthology Program Review: Enhanced, Anthology Raise: Essential, Anthology Raise: Enhanced, Anthology Raise: Enhanced+, Anthology Reach: Essential, Anthology Reach: Enhanced, Anthology Reach: Enhanced+, Anthology Student: Essential, Anthology Student: Enhanced, Ally - (T1), Ally - (T2), Ally - (T3)" def groups(): diff --git a/Scripts/API_Tests/bulk_knowledgestate_removegroups_enrollgroups.py b/Scripts/API_Tests/bulk_knowledgestate_removegroups_enrollgroups.py index 151391cf..51a84650 100644 --- a/Scripts/API_Tests/bulk_knowledgestate_removegroups_enrollgroups.py +++ b/Scripts/API_Tests/bulk_knowledgestate_removegroups_enrollgroups.py @@ -8,6 +8,9 @@ from termcolor import colored, cprint KNOWLEDGEGROUPS = [ +'7395831e-4325-4b16-85bb-36c94f68aec0', +'180571e8-f943-4980-8997-b3eed2a0c141', +'2b69f2f8-d567-48c3-8bb3-22e0dc8819bd', '3f8dc68e-1458-4199-9641-6781960e085e', '8585fe89-a050-4dbb-beb8-6ebd7358a970', 'd2542667-0dbf-4680-a5af-042d70f24a55', @@ -212,27 +215,38 @@ def bulk_remove_and_enroll(person_list, group_list): FINISH_SIGNAL = len(person_list) # Get people with groups and remove them from those groups for person in person_list: + print(person) COUNT += 1 url = BASEURL + f"people/{person}" response = requests.get(url, headers=HEADERS) + print(response.status_code) data = response.json() groups = data["data"]["relationships"]["groups"] name = data["data"]["attributes"]["full_name"] + print(name) del_group_list = [] for group in groups["data"]: del_payload_var = {"id": group["id"], "type": "membership-groups"} del_group_list.append(del_payload_var) del_payload_base = {"data": del_group_list} + print(del_payload_base) if not del_payload_base["data"]: + print("notthing in del_payload_base") pass else: - url = BASEURL + f"people/{person}/relationships/groups" - response = requests.delete(url, headers=HEADERS, json=del_payload_base) - good_status_codes = [202, 204, 200, 203] - if response.status_code in good_status_codes: + try: + durl = BASEURL + f"people/{person}/relationships/groups" + dresponse = requests.delete(durl, headers=HEADERS, json=del_payload_base) + print(dresponse.status_code) + good_status_codes = [202, 204, 200, 203] + if dresponse.status_code in good_status_codes: + pass + else: + cprint(f"Error: {response.status_code} with {name}", 'red') + except Exception as e: + print(e) + finally: pass - else: - cprint(f"Error: {response.status_code} with {name}", 'red') if COUNT == FINISH_SIGNAL: # Since we're de-enrolling one by one, let's sleep and wait. diff --git a/Tasks.md b/Tasks.md index 0eba6c8f..70b9cff4 100644 --- a/Tasks.md +++ b/Tasks.md @@ -20,6 +20,7 @@ - [X] Await Lukasz direction on changing the Artera and Hanna University Looks once the new explores are created. - 04-24-2025 - [X] Clean up Walmart Mexico S3 bucket. Wait for Hubert to share what he wants to do. - 04-24-2025 - [X] Workato webhook endpoint update. See thread with Austin, Tom, etc. - 05-01-2025 +- [ ] Workato contract - schedule meeting for week of 16th with Larry and Andy. - 06-02-2025 ## Pipedrive @@ -35,6 +36,7 @@ - [X] Upload font files to S3 and make appropriate changes in templates/custom css - 04-23-2025 - [X] Move Production templates to Sandbox - 04-23-2025 - [X] Add all users in CSV to "Active Supplier", "All Users", and "Grow with Walmart" groups. Set Locale-Person to USA. +- [ ] Delete TO DELETE group - 06-02-2025 ## Walmart Volt - [X] Start compiling ticket list and notes to send to Dan Kardell. - 04-23-2025