Took a Flask function to download templates since product is changing some of our theming and templates. Anthology CSV script was updated.
This commit is contained in:
BIN
Custom_Templates/customer_templates/.DS_Store
vendored
BIN
Custom_Templates/customer_templates/.DS_Store
vendored
Binary file not shown.
@ -44,7 +44,7 @@
|
|||||||
{% include "filter_by_product", page: 'Dashboard' %}
|
{% include "filter_by_product", page: 'Dashboard' %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="dashboard-resources-pane">
|
<div id="dashboard-resources-pane">
|
||||||
<div class="np-dashboard-resources-title">
|
<div class="np-dashboard-resources-title">
|
||||||
Your Resources
|
Your Resources
|
||||||
@ -268,4 +268,4 @@
|
|||||||
margin-bottom: 0 !important;
|
margin-bottom: 0 !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endif %} {%- endcomment -%}
|
{% endif %} {%- endcomment -%}
|
||||||
|
|||||||
@ -374,6 +374,17 @@ Maybe Anthology101? Unsure if the bars were submitted.
|
|||||||
|
|
||||||
## 01/12/2023
|
## 01/12/2023
|
||||||
|
|
||||||
### Manager Permissions, CSV Mapping, etc.
|
### Manager Permissions, CSV Mapping, etc
|
||||||
|
|
||||||
TODO: Create a course called "Manager Content - Student" with all the media library files that have STU.
|
TODO: Create a course called "Manager Content - Student" with all the media library files that have STU.
|
||||||
|
|
||||||
|
## 02/09/2023
|
||||||
|
|
||||||
|
### Katie and KC
|
||||||
|
|
||||||
|
Recently overhauled all their CSM, CXM, AE, CEM jobs that were all doing different jobs should all be doing the "same" job.
|
||||||
|
Mission structure has changed as well.
|
||||||
|
|
||||||
|
KC wants to be able to filter groups in analytics. We will need to create "account" groups.
|
||||||
|
|
||||||
|
TODO: Test Finance & HCM in the CSV flow.
|
||||||
|
|||||||
65
Scripts/API_Tests/template_download.py
Normal file
65
Scripts/API_Tests/template_download.py
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
import Apikeys
|
||||||
|
import inspect
|
||||||
|
import os
|
||||||
|
import requests
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
TEMPLATES_DIR = (
|
||||||
|
"/Users/normrasmussen/Documents/Work/Custom_Templates/Template-backup-tmp/"
|
||||||
|
)
|
||||||
|
URL = "https://api.northpass.com/"
|
||||||
|
|
||||||
|
|
||||||
|
def test():
|
||||||
|
print(name)
|
||||||
|
|
||||||
|
|
||||||
|
def template_endpoint():
|
||||||
|
for customer, apikey in inspect.getmembers(Apikeys):
|
||||||
|
global customer_path = os.path.join(TEMPLATES_DIR, customer)
|
||||||
|
os.mkdir(customer_path)
|
||||||
|
|
||||||
|
count = 0
|
||||||
|
templates = []
|
||||||
|
|
||||||
|
while True:
|
||||||
|
count += 1
|
||||||
|
endpoint = f"v2/custom_templates?page={count}"
|
||||||
|
headers = {
|
||||||
|
"accept": "application/json",
|
||||||
|
"content-type": "application/json",
|
||||||
|
"X-Api-Key": apikey,
|
||||||
|
}
|
||||||
|
response = requests.get(URL + endpoint, headers=headers)
|
||||||
|
data = response.json()
|
||||||
|
for response in data["data"]:
|
||||||
|
last_updated = response["attributes"]["updated_at"].split("T")
|
||||||
|
# full_updated = response["attributes"]["updated_at"]
|
||||||
|
# full_updated = datetime.fromisoformat(full_updated)
|
||||||
|
last_updated = last_updated[0]
|
||||||
|
name, body, last_updated = (
|
||||||
|
response["attributes"]["name"],
|
||||||
|
response["attributes"]["body"],
|
||||||
|
last_updated,
|
||||||
|
)
|
||||||
|
templates.append((name, body, last_updated))
|
||||||
|
|
||||||
|
if data["data"] == []:
|
||||||
|
break
|
||||||
|
|
||||||
|
save_templates(templates)
|
||||||
|
|
||||||
|
|
||||||
|
def save_templates(templates):
|
||||||
|
for tupe in templates:
|
||||||
|
file_name = tupe[0] + ".liquid"
|
||||||
|
file_body = tupe[1]
|
||||||
|
final_path = os.path.join(customer_path, file_name)
|
||||||
|
|
||||||
|
with open(final_path, "w+") as temp:
|
||||||
|
temp.write(file_body)
|
||||||
|
temp.close
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
template_endpoint()
|
||||||
@ -33,7 +33,7 @@ function main(previousLast) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
austinComparseData(outdated_data, updated_data);
|
austinComparseData(outdated_data, updated_data);
|
||||||
//moveOldFiles();
|
moveOldFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveOldFiles() {
|
function moveOldFiles() {
|
||||||
|
|||||||
Reference in New Issue
Block a user