Cin7 Templates, DVU templates, and G2 templates. Finished the mass delete script. Fun fact, dev docs are wrong... it's not a 15,000 limit, but 1500.
This commit is contained in:
@ -26,6 +26,10 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<div class="col-xs-12 col-md-6 col-lg-4 np-stretch-content">
|
||||
{% include "cards_course" with course %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
@ -38,7 +38,37 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% elsif log_out or partners %}
|
||||
{% elsif log_out %}
|
||||
<div class="filter-option-container" id="categoryFilters">
|
||||
{% assign unique_core_categories = "" %}
|
||||
{% for course in courses.in_catalog %}
|
||||
{% for category in course.categories %}
|
||||
{% unless unique_core_categories contains category.name %}
|
||||
<div class="category-option">
|
||||
<input class="filter-checkbox" type="checkbox" id="{{category.name}}" />
|
||||
<label>{{category.name}}</label>
|
||||
</div>
|
||||
{% assign unique_core_categories = unique_core_categories | append: category.name %}
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% elsif partners %}
|
||||
<div class="filter-option-container" id="categoryFilters">
|
||||
{% assign unique_core_categories = "" %}
|
||||
{% for course in courses.in_catalog %}
|
||||
{% for category in course.categories %}
|
||||
{% unless unique_core_categories contains category.name %}
|
||||
<div class="category-option">
|
||||
<input class="filter-checkbox" type="checkbox" id="{{category.name}}" />
|
||||
<label>{{category.name}}</label>
|
||||
</div>
|
||||
{% assign unique_core_categories = unique_core_categories | append: category.name %}
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="filter-option-container" id="categoryFilters">
|
||||
{% assign unique_core_categories = "" %}
|
||||
{% for course in courses.in_catalog %}
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<span class="uk-text-large uk-text-bold">{{ current_school.name }}</span>
|
||||
{% endif %}
|
||||
</a>
|
||||
<div class="uk-navbar-flip">
|
||||
<div class="uk-navbar-flip">
|
||||
<ul class="uk-navbar-nav uk-hidden-small">
|
||||
{% for website_navigation in header_navigations %}
|
||||
<!--<li>
|
||||
@ -16,7 +16,7 @@
|
||||
{{ website_navigation.name }}
|
||||
</a>
|
||||
</li>-->
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
|
||||
{% search %}
|
||||
<li class="uk-padding-top">
|
||||
@ -38,14 +38,14 @@
|
||||
<li>
|
||||
<a href="#" class="uk-button uk-button-primary get-in-touch-btn" id="achievement-btn">ACHIEVEMENTS</a></li>
|
||||
</li>
|
||||
|
||||
|
||||
<li>
|
||||
<a href="#" class="uk-button uk-button-primary get-in-touch-btn" id="get-in-touch">GET IN TOUCH</a></li>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ routes.log_out_path }}" class="profile-icon" data-method="delete" rel="nofollow"> <span>{% t .log_out %}</span></a>
|
||||
</li>
|
||||
{% for group in current_person.groups %}
|
||||
{% for group in current_person.groups %}
|
||||
{% if group.name == "language dropdown test group" %}
|
||||
<li class="uk-parent" data-uk-dropdown="{mode:'click'}">
|
||||
<a href="#" class="uk-button uk-button-primary lang-btn">语Aa</a>
|
||||
@ -53,34 +53,26 @@
|
||||
<ul class="uk-nav uk-nav-navbar">
|
||||
<li><a onclick="setLang('English')">English</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('Russian')">Russian (Pусский)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('Japanese')">Japanese (日本語)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('Spanish')">Spanish (Español)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('German')">German (Deutsch)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('French')">French (Français)</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="uk-parent" data-uk-dropdown="{mode:'click'}">
|
||||
<a href="#" class="uk-button uk-button-primary lang-btn">语Aa</a>
|
||||
<a href="#" class="uk-button uk-button-primary lang-btn">语Aa</a>
|
||||
<div class="uk-dropdown uk-dropdown-flip uk-dropdown-navbar">
|
||||
<ul class="uk-nav uk-nav-navbar">
|
||||
<li><a onclick="setLang('English')">English</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('Spanish')">Spanish (Español)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('Russian')">Russian (Pусский)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('Japanese')">Japanese (日本語)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('German')">German (Deutsch)</a></li>
|
||||
<li class="uk-nav-divider"></li>
|
||||
<li><a onclick="setLang('French')">French (Français)</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
@ -147,13 +139,13 @@
|
||||
|
||||
<div class="overlay highlight-overlay" id="overlay">
|
||||
<div class="overlay-table">
|
||||
<div class="overlay-cell">
|
||||
<div class="overlay-cell">
|
||||
<div class="overlay-container">
|
||||
<button class="overlay-close button-close" id="close-btn" type="button">Close Overlay</button>
|
||||
<div class="overlay-main-content">
|
||||
<p class="overlay-description">For any questions about DV University or DoubleVerify, please contact <a href="mailto:dvusupport@doubleverify.com">dvusupport@doubleverify.com</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -171,13 +163,13 @@
|
||||
<div class="all-certificate_wrap">
|
||||
<div class="all-certificate_list">
|
||||
<ul class="certificate-list" id="certificate-list">
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="completed-icon course-locked small-icon">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2020/12/right-tick.png" alt="completed icon">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2022/05/course-locked.svg" alt="locked">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -188,8 +180,8 @@
|
||||
<div class="cert-badge-logo">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2021/03/DV_ELM_Badges_Blueprint.png" id="iq_blueprint_badge_logo" class="filter-gray iq-badge-logo" alt="Blueprint badge">
|
||||
</div>
|
||||
|
||||
<div class="cert-badge-course iq_blueprint_badge">
|
||||
|
||||
<div class="cert-badge-course iq_blueprint_badge">
|
||||
{% if current_person.properties.language == 'English' %}
|
||||
{% assign iq_blueprint_badge_ids = "189c66ba-9d61-4bf8-a2aa-f5a2ddccfa59, 1ec77a63-095e-4e83-adc3-75cb91d91af6, c320ea8c-35ba-4fab-b26c-a7733e719aa1" | split: ','%}
|
||||
{% else if current_person.properties.language == 'Spanish' %}
|
||||
@ -203,7 +195,7 @@
|
||||
{% else if current_person.properties.language == 'French' %}
|
||||
{% assign iq_blueprint_badge_ids = "07d0ae43-49ac-4183-9ef6-56541165b7e4, 2b4cb076-03e9-420a-b4fe-808a5d918452, 6ecc6f58-0379-48cc-af2d-47aea42136f4" | split: ','%}
|
||||
{% endif %}
|
||||
|
||||
|
||||
<ul class="cert-course-list" id="iq_blueprint_course-list">
|
||||
{% for course in my_content.courses %}
|
||||
<!-- {% if course.properties.language == current_person.properties.language %} -->
|
||||
@ -225,8 +217,8 @@
|
||||
<div class="cert-badge-logo">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2021/03/DV_ELM_Badges_Analytics.png" class="filter-gray iq-badge-logo" alt="Quality Analytics Badge">
|
||||
</div>
|
||||
|
||||
<div class="cert-badge-course iq_performance_badge">
|
||||
|
||||
<div class="cert-badge-course iq_performance_badge">
|
||||
{% if current_person.properties.language == 'English' %}
|
||||
{% assign iq_performance_badge_ids = "96f8474f-453e-416b-8d3f-0a0b8e9fbad1" | split: ','%}
|
||||
{% else if current_person.properties.language == 'Spanish' %}
|
||||
@ -258,8 +250,8 @@
|
||||
|
||||
<div class="cert-badge-block" data-cert-img="" data-cert-title="" data-cert-name="tag_generator" data-cert-id="">
|
||||
<div class="cert-badge-logo"><img src="https://doubleverify.com/wp-content/uploads/2024/02/DV_ELM_Badges_TaggingSolutions.png" class="filter-gray iq-badge-logo" alt="Tag Generator Badge"></div>
|
||||
|
||||
<div class="cert-badge-course tag_generator_badge">
|
||||
|
||||
<div class="cert-badge-course tag_generator_badge">
|
||||
{% if current_person.properties.language == 'English' %}
|
||||
{% assign tag_generator_badge_ids = "f46d2369-dfcb-4108-8225-336c4759f877" | split: ','%}
|
||||
{% else if current_person.properties.language == 'Spanish' %}
|
||||
@ -286,13 +278,13 @@
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2020/12/right-tick.png" alt="completed icon">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2022/05/course-locked.svg" alt="locked">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cert-badge-block" data-cert-img="" data-cert-title="" data-cert-name="social_solution" data-cert-id="">
|
||||
<div class="cert-badge-logo"><img src="https://doubleverify.com/wp-content/uploads/2022/05/social-solutions.png" class="filter-gray iq-badge-logo" alt="Social Solutions Badge"></div>
|
||||
|
||||
<div class="cert-badge-course social_solution_badge">
|
||||
|
||||
|
||||
<div class="cert-badge-course social_solution_badge">
|
||||
|
||||
{% if current_person.properties.language == 'English' %}
|
||||
{% assign social_solution_badge_ids = "d97ef57a-b004-4459-88f5-9ae5ebdf2c2d" | split: ','%}
|
||||
{% else if current_person.properties.language == 'Spanish' %}
|
||||
@ -319,13 +311,13 @@
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2020/12/right-tick.png" alt="completed icon">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2022/05/course-locked.svg" alt="locked">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cert-badge-block" data-cert-img="" data-cert-title="" data-cert-name="programmatic_solutions" data-cert-id="">
|
||||
<div class="cert-badge-logo"><img src="https://doubleverify.com/wp-content/uploads/2022/05/programmatic-solutions.png" class="filter-gray iq-badge-logo" alt="programmatic Solutions Badge"></div>
|
||||
|
||||
<div class="cert-badge-course programmatic_solutions_badge">
|
||||
|
||||
|
||||
<div class="cert-badge-course programmatic_solutions_badge">
|
||||
|
||||
{% if current_person.properties.language == 'English' %}
|
||||
{% assign programmatic_solutions_badge_ids = "1ab6a178-6b95-486a-900c-9374c0773ae0" | split: ','%}
|
||||
{% else if current_person.properties.language == 'Spanish' %}
|
||||
@ -356,9 +348,9 @@
|
||||
|
||||
<div class="cert-badge-block" data-cert-img="" data-cert-title="" data-cert-name="authentic_attention" data-cert-id="">
|
||||
<div class="cert-badge-logo"><img src="https://doubleverify.com/wp-content/uploads/2022/06/DV_ELM_Badges__Authentic-Attention-1.png" class="filter-gray iq-badge-logo" alt="Authentic Attention Badge"></div>
|
||||
|
||||
<div class="cert-badge-course authentic_attention_badge">
|
||||
|
||||
|
||||
<div class="cert-badge-course authentic_attention_badge">
|
||||
|
||||
{% if current_person.properties.language == 'English' %}
|
||||
{% assign authentic_attention_badge_ids = "409a0308-924b-4d88-bdd8-aac3c226ffdf" | split: ','%}
|
||||
{% else if current_person.properties.language == 'Spanish' %}
|
||||
@ -389,9 +381,9 @@
|
||||
|
||||
<div class="cert-badge-block" data-cert-img="" data-cert-title="" data-cert-name="pinnacle_publishers" data-cert-id="">
|
||||
<div class="cert-badge-logo"><img src="https://doubleverify.com/wp-content/uploads/2024/04/DV_ELM_Badge_PinnacleForPub.png" class="filter-gray iq-badge-logo" alt="DV Pinnacle Publishers Badge"></div>
|
||||
|
||||
<div class="cert-badge-course pinnacle_publishers_badge">
|
||||
|
||||
|
||||
<div class="cert-badge-course pinnacle_publishers_badge">
|
||||
|
||||
{% if current_person.properties.language == 'English' %}
|
||||
{% assign pinnacle_publishers_badge_ids = "738021ce-297b-4397-84e6-a3b5ea68f168" | split: ','%}
|
||||
{% else if current_person.properties.language == 'Spanish' %}
|
||||
@ -420,16 +412,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="shareable-note">Please note that shareable versions of your badges and certifications are delivered via email within one business day of completing your assigned courses. Please reach out to <a href="mailto:dvusupport@doubleverify.com">dvusupport@doubleverify.com</a> with any questions.</p>
|
||||
|
||||
<div class="modal-bg-shape">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2019/11/purple-lines-hero-dark-no-shadow.svg" alt="image">
|
||||
<img src="https://doubleverify.com/wp-content/uploads/2019/11/purple-lines-hero-dark-no-shadow.svg" alt="image">
|
||||
</div>
|
||||
<!-- .modal-bg-shape -->
|
||||
</div>
|
||||
<!-- .modal-text -->
|
||||
|
||||
|
||||
</div><!-- .modal-content -->
|
||||
</div>
|
||||
|
||||
@ -484,8 +476,8 @@
|
||||
document.getElementById('certificate-list').innerHTML = li;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
/*var badge_completed = 0;
|
||||
var badge_completed_list = Array();
|
||||
var iq_cert_block = document.querySelectorAll('.cert-badge-block');
|
||||
@ -526,7 +518,7 @@
|
||||
var certificate_list = certificate_modal.querySelectorAll('.certificate-list')[0].querySelectorAll('li');
|
||||
for(var i = 0; i < certificate_list.length; i++ ){
|
||||
certificate_modal.querySelectorAll('.certificate-list')[0].getElementsByTagName('li')[i].classList.remove('filter-gray');
|
||||
}
|
||||
}
|
||||
var all_certificate_list = certificate_modal.querySelectorAll('.all-certificate_list')[0];
|
||||
all_certificate_list.querySelectorAll('.completed-icon')[0].classList.remove('course-locked');
|
||||
all_certificate_list.querySelectorAll('.completed-icon')[0].classList.add('completed-active');
|
||||
@ -541,7 +533,7 @@ function setLang(lang) {
|
||||
};
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : 'https://hooks.zapier.com/hooks/catch/8404380/b2oee3b/', //zapier link
|
||||
url : 'https://hooks.zapier.com/hooks/catch/8404380/b2oee3b/', //zapier link
|
||||
data: JSON.stringify(data),
|
||||
success:function (data) {
|
||||
console.log(data);
|
||||
@ -553,4 +545,4 @@ function setLang(lang) {
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
@ -46,6 +46,16 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% if course.id == "1d10edc4-6414-4707-891b-8daab9927070" %}
|
||||
<div class='np-course-bottom-right'>
|
||||
<div class='np-course-bottom-right-title'>
|
||||
About this kit
|
||||
</div>
|
||||
<div class='np-course-bottom-right-description'>
|
||||
{{ course.short_description }}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class='np-course-bottom-right'>
|
||||
<div class='np-course-bottom-right-title'>
|
||||
About this course
|
||||
@ -54,6 +64,7 @@
|
||||
{{ course.short_description }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -17,7 +17,11 @@
|
||||
{% if course.enrolled? == false %}
|
||||
{% t shared.enroll %}
|
||||
{% elsif course.started? == false %}
|
||||
{% t shared.course.start, key: current_school.course_vocabulary %}
|
||||
{% if course.id == "1d10edc4-6414-4707-891b-8daab9927070" %}
|
||||
Explore this Kit
|
||||
{% else %}
|
||||
{% t shared.course.start, key: current_school.course_vocabulary %}
|
||||
{% endif %}
|
||||
{% elsif course.completed? %}
|
||||
{% t shared.course.view, key: current_school.course_vocabulary %}
|
||||
{% else %}
|
||||
@ -35,4 +39,4 @@
|
||||
font-weight: 700;
|
||||
border-radius: 100px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -13,5 +13,10 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</nav>
|
||||
{% if current_school.properties.show_office_hours_banner == true %}
|
||||
<div class="np-alert" >
|
||||
{{ current_school.properties.office_hours_banner }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% include "badges" %}
|
||||
|
||||
33
Scripts/API_Tests/Sandata_errors.txt
Normal file
33
Scripts/API_Tests/Sandata_errors.txt
Normal file
File diff suppressed because one or more lines are too long
@ -1,4 +1,5 @@
|
||||
import Apikeys
|
||||
import json
|
||||
import requests
|
||||
import pandas as pd
|
||||
import pprint
|
||||
@ -8,10 +9,24 @@ df = pd.DataFrame()
|
||||
BASEURL = "https://api.northpass.com/v2"
|
||||
LEARNFILTER = "?filter[partnerships_type][eq]=Partnerships::Learner"
|
||||
APIKEY = Apikeys.SANDATA
|
||||
HEADERS = {"accept": "application/json", "X-Api-Key": APIKEY}
|
||||
HEADERS = {"accept": "application/json", "content-type": "application/json", "X-Api-Key": APIKEY}
|
||||
PERSON_GROUPS = []
|
||||
PPL_DELETIONS = []
|
||||
GROUPS_LIST = []
|
||||
ADMINS_NOT_TO_DELETE = [
|
||||
"269b4e46-74fa-49f9-b1a3-59a15180b377",
|
||||
"23eb155c-395f-40a5-adb8-ef348bc85051",
|
||||
"cebe6de7-af0d-46cb-bf0a-a461fb0bed63",
|
||||
"e134030d-a2a9-4de2-b4d5-87081feee18a",
|
||||
"65b6924b-e0b3-4e8d-a9ff-140fb9de9453",
|
||||
"1cc4762e-3a6d-48b5-a8bf-bbe98e00c72e",
|
||||
"5c457837-5ad5-486e-86b7-ea65353565b0",
|
||||
"5e89fba5-3d12-4961-af46-2f4f131e7387",
|
||||
"b0098337-7b7e-45e5-b645-e71c40387cbb",
|
||||
"c111dc44-470e-4c74-a7ce-688dff5e3476",
|
||||
"a6c6469b-8978-4899-a9c8-bbc5cdb29e5e",
|
||||
]
|
||||
|
||||
|
||||
def get_groups():
|
||||
count = 1
|
||||
@ -31,7 +46,6 @@ def get_groups():
|
||||
else:
|
||||
if members > 0:
|
||||
grouple = (id, group_name, members)
|
||||
print(grouple)
|
||||
GROUPS_LIST.append(grouple)
|
||||
|
||||
if "next" not in nextlink:
|
||||
@ -39,6 +53,7 @@ def get_groups():
|
||||
|
||||
get_ppl_from_groups(GROUPS_LIST)
|
||||
|
||||
|
||||
def get_ppl_from_groups(GROUPS_LIST):
|
||||
for single_group in GROUPS_LIST:
|
||||
print(single_group)
|
||||
@ -52,13 +67,102 @@ def get_ppl_from_groups(GROUPS_LIST):
|
||||
|
||||
for data in groupson["data"]:
|
||||
id = data["relationships"]["person"]["data"]["id"]
|
||||
print(id)
|
||||
if id in ADMINS_NOT_TO_DELETE:
|
||||
pass
|
||||
else:
|
||||
PPL_DELETIONS.append(id)
|
||||
|
||||
if "next" not in nextlink:
|
||||
break
|
||||
|
||||
print("Deleting People.... Hold on to your butts.")
|
||||
if len(PPL_DELETIONS) > 1500:
|
||||
for chunk in range(0, len(PPL_DELETIONS), 1500):
|
||||
i = chunk
|
||||
delete_url = f"{BASEURL}/bulk/people/delete"
|
||||
chunk_to_del = PPL_DELETIONS[i:i+1500]
|
||||
payload = { "payload": chunk_to_del }
|
||||
print(payload)
|
||||
try:
|
||||
del_resp = requests.post(delete_url, json=payload, headers=HEADERS)
|
||||
print(del_resp)
|
||||
if del_resp.status_code == 400:
|
||||
print(
|
||||
f"Issue with Group: {single_group[1]}... {del_resp.status_code} - {del_resp.text}"
|
||||
)
|
||||
print("Writing person IDs to file...")
|
||||
with open("./Sandata_errors.txt", "a") as file:
|
||||
file.write(f"{single_group}... \n {payload}")
|
||||
file.close()
|
||||
if del_resp.status_code == 401:
|
||||
print(
|
||||
f"Issue with Group: {single_group[1]}... {del_resp.status_code} - {del_resp.text}"
|
||||
)
|
||||
print("Writing person IDs to file...")
|
||||
with open("./Sandata_errors.txt", "a") as file:
|
||||
file.write(f"{single_group}... \n {payload} \n")
|
||||
file.close()
|
||||
if del_resp.status_code == 422:
|
||||
print(
|
||||
f"Issue with body for Group: {single_group[1]}... {del_resp.status_code} - {del_resp.text}"
|
||||
)
|
||||
print("Writing person IDs to file...")
|
||||
with open("./Sandata_errors.txt", "a") as file:
|
||||
file.write(f"{single_group}... \n {payload} \n")
|
||||
file.close()
|
||||
status = str(del_resp.status_code)
|
||||
if "20" in status:
|
||||
print(f"Some success! Status code: {del_resp.status_code}")
|
||||
except requests.exceptions.HTTPError as h:
|
||||
print(f"Exception HTTPError: {h} \n Passing onto next loop.")
|
||||
pass
|
||||
finally:
|
||||
print(f"{single_group[1]} has been completed. Moving onto next group.")
|
||||
else:
|
||||
delete_url = f"{BASEURL}/bulk/people/delete"
|
||||
payload = { "payload": PPL_DELETIONS }
|
||||
try:
|
||||
del_resp = requests.post(delete_url, json=payload, headers=HEADERS)
|
||||
print(del_resp)
|
||||
if del_resp.status_code == 400:
|
||||
print(
|
||||
f"Issue with Group: {single_group[1]}... {del_resp.status_code} - {del_resp.text}"
|
||||
)
|
||||
print("Writing person IDs to file...")
|
||||
with open("./Sandata_errors.txt", "a") as file:
|
||||
file.write(f"{single_group}... \n {payload}")
|
||||
file.close()
|
||||
if del_resp.status_code == 401:
|
||||
print(
|
||||
f"Issue with Group: {single_group[1]}... {del_resp.status_code} - {del_resp.text}"
|
||||
)
|
||||
print("Writing person IDs to file...")
|
||||
with open("./Sandata_errors.txt", "a") as file:
|
||||
file.write(f"{single_group}... \n {payload} \n")
|
||||
file.close()
|
||||
if del_resp.status_code == 422:
|
||||
print(
|
||||
f"Issue with body for Group: {single_group[1]}... {del_resp.status_code} - {del_resp.text}"
|
||||
)
|
||||
print("Writing person IDs to file...")
|
||||
with open("./Sandata_errors.txt", "a") as file:
|
||||
file.write(f"{single_group}... \n {payload} \n")
|
||||
file.close()
|
||||
status = str(del_resp.status_code)
|
||||
if "20" in status:
|
||||
print(f"Some success! Status code: {del_resp.status_code}")
|
||||
except requests.exceptions.HTTPError as h:
|
||||
print(f"Exception HTTPError: {h} \n Passing onto next loop.")
|
||||
pass
|
||||
finally:
|
||||
print(f"{single_group[1]} has been completed. Moving onto next group.")
|
||||
|
||||
|
||||
|
||||
def get_people():
|
||||
"""
|
||||
This is no longer being used.
|
||||
"""
|
||||
count = 0
|
||||
while True:
|
||||
url = f"{BASEURL}/people{LEARNFILTER}&limit=100&page={count}"
|
||||
@ -95,12 +199,12 @@ def get_people():
|
||||
except JSONDecodeError as e:
|
||||
print(f"There was a JSON Error --> {e}")
|
||||
dataerror = df.from_records(PERSON_GROUPS)
|
||||
dataerror.to_csv('~/Downloads/Sandata-err-all-ppl')
|
||||
dataerror.to_csv("~/Downloads/Sandata-err-all-ppl")
|
||||
print(dataerror)
|
||||
print(len(PERSON_GROUPS))
|
||||
|
||||
datadelerr = df.from_records(PPL_DELETIONS)
|
||||
datadelerr.to_csv('~/Downloads/Sandata-err-ppl-to-delete')
|
||||
datadelerr.to_csv("~/Downloads/Sandata-err-ppl-to-delete")
|
||||
pass
|
||||
finally:
|
||||
pass
|
||||
@ -112,12 +216,12 @@ def get_people():
|
||||
break
|
||||
|
||||
dataframe = df.from_records(PERSON_GROUPS)
|
||||
dataframe.to_csv('~/Downloads/Sandata-all-ppl')
|
||||
dataframe.to_csv("~/Downloads/Sandata-all-ppl")
|
||||
print(dataframe)
|
||||
print(len(PERSON_GROUPS))
|
||||
|
||||
datadel = df.from_records(PPL_DELETIONS)
|
||||
datadel.to_csv('~/Downloads/Sandata-ppl-to-delete')
|
||||
datadel.to_csv("~/Downloads/Sandata-ppl-to-delete")
|
||||
|
||||
|
||||
# def parse_groups(id, grouplist):
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
string = "["33410b8a-246b-4253-9fc0-829d67fb1834", "70b43bcf-3261-49d3-8940-0c14f6445888", "5cfc2cb6-7de1-4b33-b945-65fe72a9ddd9", "3d3de462-e29c-4a89-ae60-3a70ec1643a9","1188e41f-b4ac-4b04-9fe5-1bc87883f58b", "9de55b7b-cb41-408e-a6f5-e28d34e4815c", "09354d84-743b-44ea-a4a5-c24697170036", "8c71009d-3210-4897-92f0-cb44b6025343","6b58f46b-1191-4436-aced-67e8d7515e74", "4ea5234d-70a2-46ed-a9aa-f4bc4dfc0769"]"
|
||||
|
||||
response = string.replace('"', "'")
|
||||
print(response)
|
||||
3
Scripts/API_Tests/test.py
Normal file
3
Scripts/API_Tests/test.py
Normal file
File diff suppressed because one or more lines are too long
1
Scripts/API_Tests/tmp.md
Normal file
1
Scripts/API_Tests/tmp.md
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user