diff --git a/Custom_Templates/customer_templates/Walmart Luminate Prod/_cards_course.html.liquid b/Custom_Templates/customer_templates/Walmart Luminate Prod/_cards_course.html.liquid index 20fa9914..ca884b5c 100644 --- a/Custom_Templates/customer_templates/Walmart Luminate Prod/_cards_course.html.liquid +++ b/Custom_Templates/customer_templates/Walmart Luminate Prod/_cards_course.html.liquid @@ -34,26 +34,44 @@ {% endif %}
diff --git a/Custom_Templates/customer_templates/Walmart Luminate Prod/_course_progress_and_cta.html.liquid b/Custom_Templates/customer_templates/Walmart Luminate Prod/_course_progress_and_cta.html.liquid index 230af85c..31ea28a8 100644 --- a/Custom_Templates/customer_templates/Walmart Luminate Prod/_course_progress_and_cta.html.liquid +++ b/Custom_Templates/customer_templates/Walmart Luminate Prod/_course_progress_and_cta.html.liquid @@ -88,7 +88,7 @@ t.setAttribute("data-firstname", "{{ current_person.first_name }}"); t.setAttribute("data-lastname", "{{ current_person.last_name }}"); t.setAttribute("data-email", "{{ current_person.email }}"); - t.setAttribute("data-redirectionurl", "https://luminatesandbox.northpass.com/app/courses/{{ course.id }}"); //url they are currently on + t.setAttribute("data-redirectionurl", "https://walmartluminate.northpass.com/app/courses/{{ course.id }}"); //url they are currently on t.setAttribute("data-snappayurl", "https://snappayglobal.com/Interop/HostedPaymentPage"); document.getElementsByTagName("head")[0].appendChild(t); return false; @@ -118,7 +118,7 @@ alert.appendChild(error_text) sessionStorage.clear() } else { - window.location.replace('https://luminatesandbox.northpass.com/c/{{ course.enrollment_code }}') + window.location.replace('https://walmartluminate.northpass.com/c/{{ course.enrollment_code }}') sessionStorage.clear() } // Set course prop as whole number, if 0, don't do anything diff --git a/Custom_Templates/customer_templates/Walmart Luminate Prod/_head.html.liquid b/Custom_Templates/customer_templates/Walmart Luminate Prod/_head.html.liquid index a7a77fa4..7a45c8f9 100644 --- a/Custom_Templates/customer_templates/Walmart Luminate Prod/_head.html.liquid +++ b/Custom_Templates/customer_templates/Walmart Luminate Prod/_head.html.liquid @@ -5,4 +5,5 @@ + diff --git a/Scripts/API_Tests/bulk_invite_and_props.py b/Scripts/API_Tests/bulk_invite_and_props.py index aca60c68..d056a2ac 100644 --- a/Scripts/API_Tests/bulk_invite_and_props.py +++ b/Scripts/API_Tests/bulk_invite_and_props.py @@ -13,7 +13,7 @@ HEADERS = { "X-Api-Key": APIKEY, } BASEURL = "https://api.northpass.com/v2/" -IMPORTFILE = "/Users/normrasmussen/Downloads/chubb-cisa-624.csv" +IMPORTFILE = "/Users/normrasmussen/Downloads/CISA-061724.csv" def bulk_invite_and_group(): @@ -30,39 +30,35 @@ def bulk_invite_and_group(): data = pd.read_csv(IMPORTFILE) groups = data["Group"].unique() groups = list(groups) - try: - for group in groups: - payload = "" - tmp_group = data[data.Group == group] - people = list(tmp_group["Email"]) - group = str(tmp_group["Group"].unique())[2:-2] - print(f"Group --> {group} & Email Length --> {len(people)}") - url = f"{BASEURL}bulk/people" - if len(people) > 1500: - for chunk in range(0, len(people), 1500): - i = chunk - payload_1 = [] - i_to_add = people[i : i + 1500] - for person in i_to_add: - miniload = {"email": person, "groups": group} - payload_1.append(miniload) - print(f"The long length {group} payload has {len(payload_1)}") - payload = {"data": {"attributes": {"people": payload_1}}} - response = requests.post(url, headers=HEADERS, json=payload) - print(f"Completed. Status code is {response.status_code}") - else: + for group in groups: + payload = "" + tmp_group = data[data.Group == group] + people = list(tmp_group["Email"]) + group = str(tmp_group["Group"].unique())[2:-2] + print(f"Group --> {group} & Email Length --> {len(people)}") + url = f"{BASEURL}bulk/people" + if len(people) > 1500: + for chunk in range(0, len(people), 1500): + i = chunk payload_1 = [] - for person in people: + i_to_add = people[i : i + 1500] + for person in i_to_add: miniload = {"email": person, "groups": group} payload_1.append(miniload) - # print(f"The {group} payload has {len(payload_1)}") + print(f"The long length {group} payload has {len(payload_1)}") payload = {"data": {"attributes": {"people": payload_1}}} response = requests.post(url, headers=HEADERS, json=payload) print(f"Completed. Status code is {response.status_code}") - print(response.text) - except: - pass - finally: + else: + payload_1 = [] + for person in people: + miniload = {"email": person, "groups": group} + payload_1.append(miniload) + # print(f"The {group} payload has {len(payload_1)}") + payload = {"data": {"attributes": {"people": payload_1}}} + response = requests.post(url, headers=HEADERS, json=payload) + print(f"Completed. Status code is {response.status_code}") + print(response.text) print("Running add props from func...") time.sleep(3) add_props_from_func(people, data) @@ -95,12 +91,14 @@ def add_props_from_func(people, data): propresponse = requests.post(prop_url, json=payload, headers=HEADERS) print(propresponse.status_code) if propresponse.status_code != 200: - error_tupe = (learner_uud, learner_email, agency_name) + error_tupe = (learner_uuid, learner_email, agname) errorlist.append(error_tupe) else: - print(f"Looks like {learner_email} and {agency_name} was successful.") - except TypeError as e: - pass + print(f"Looks like {learner_email} and {agname} was successful.") + except ( TypeError,IndexError ) as e: + error_tupe = (0, learner_email, agency_name) + errorlist.append(error_tupe) + print(f"{e} has occurred with {learner_email}") finally: print(f"Error list: {errorlist}")