2023-02-17 16:59:42 -05:00
|
|
|
import requests
|
2023-02-22 17:11:14 -05:00
|
|
|
import itertools
|
2023-02-17 16:59:42 -05:00
|
|
|
import pandas as pd
|
|
|
|
|
import re
|
2023-03-02 17:56:31 -05:00
|
|
|
import os
|
2023-03-08 16:11:32 -05:00
|
|
|
import csv
|
2023-03-02 17:56:31 -05:00
|
|
|
from app import app
|
2023-03-07 14:56:01 -05:00
|
|
|
from flask import (
|
|
|
|
|
redirect,
|
|
|
|
|
flash,
|
|
|
|
|
request,
|
|
|
|
|
render_template,
|
|
|
|
|
session,
|
|
|
|
|
make_response,
|
|
|
|
|
url_for,
|
|
|
|
|
)
|
2023-03-03 20:47:37 -05:00
|
|
|
from werkzeug.utils import secure_filename
|
2023-03-02 17:56:31 -05:00
|
|
|
|
2023-03-06 09:33:42 -05:00
|
|
|
# Global Variables
|
|
|
|
|
url = "https://api.northpass.com/"
|
|
|
|
|
|
2023-03-02 17:56:31 -05:00
|
|
|
# Upload folder
|
2023-03-07 14:56:01 -05:00
|
|
|
UPLOAD_FOLDER = "/Users/normrasmussen/Documents/Projects/CSM_webapp/app/static/files"
|
2023-03-03 20:47:37 -05:00
|
|
|
# UPLOAD_FOLDER = 'static/files'
|
2023-03-07 14:56:01 -05:00
|
|
|
app.config["UPLOAD_FOLDER"] = UPLOAD_FOLDER
|
|
|
|
|
ALLOWED_EXTENSIONS = {"csv"}
|
2023-02-17 16:59:42 -05:00
|
|
|
|
|
|
|
|
|
2023-03-06 09:33:42 -05:00
|
|
|
def download_csv():
|
|
|
|
|
if request.method == "GET":
|
|
|
|
|
download = make_response(session["dfcsv"])
|
|
|
|
|
download.headers["Content-Disposition"] = "attachment; filename=export.csv"
|
|
|
|
|
download.headers["Content-Type"] = "text/csv"
|
|
|
|
|
return download
|
|
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-01 17:05:16 -05:00
|
|
|
def key_response(response):
|
|
|
|
|
if "402" in str(response):
|
|
|
|
|
error = response.text
|
2023-03-09 15:15:42 -05:00
|
|
|
return render_template("index.html", title="Error Home", error=error)
|
2023-03-02 17:56:31 -05:00
|
|
|
if "401" in str(response):
|
2023-02-27 16:04:19 -05:00
|
|
|
error = [
|
2023-03-02 17:56:31 -05:00
|
|
|
"Unauthorized access error.",
|
|
|
|
|
"This can mean a lot of things,",
|
|
|
|
|
"such as the key being changed.",
|
2023-03-01 17:05:16 -05:00
|
|
|
"Remember, they are paired to each educator!",
|
2023-02-27 16:04:19 -05:00
|
|
|
]
|
2023-03-09 15:15:42 -05:00
|
|
|
return render_template("index.html", title="Error Home", error=error)
|
2023-03-02 17:56:31 -05:00
|
|
|
return correct_key(response)
|
2023-02-27 16:04:19 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def correct_key(response):
|
|
|
|
|
data = response.json()
|
|
|
|
|
session["school"] = data["data"]["attributes"]["properties"]["name"]
|
2023-03-09 15:15:42 -05:00
|
|
|
return render_template("bulk_add.html", title="Active Session")
|
2023-02-27 16:04:19 -05:00
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-06 09:33:42 -05:00
|
|
|
def allowed_file(filename):
|
2023-03-07 14:56:01 -05:00
|
|
|
return "." in filename and filename.rsplit(".", 1)[1].lower() in ALLOWED_EXTENSIONS
|
2023-02-27 16:04:19 -05:00
|
|
|
|
2023-03-08 16:11:32 -05:00
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
# DONE: Remove header for main page.
|
2023-03-07 17:52:36 -05:00
|
|
|
# DONE: Leave boxes but change outcome depending if file has been uploaded.
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-06 09:33:42 -05:00
|
|
|
|
2023-02-17 16:59:42 -05:00
|
|
|
@app.route("/", methods=["GET", "POST"])
|
|
|
|
|
def ask_key():
|
2023-03-02 17:56:31 -05:00
|
|
|
"""This is the main function that asks for the API Key.
|
|
|
|
|
Without this key, no other functions will work.
|
|
|
|
|
It also assigns the api key to the session and clears the session upon each reload.
|
|
|
|
|
"""
|
2023-03-09 15:15:42 -05:00
|
|
|
specials = '"!@#$%^&*()-+?_=,<>/"'
|
|
|
|
|
#if session.get("key"):
|
|
|
|
|
# return render_template("bulk_add.html", title="Options Home")
|
2023-02-17 16:59:42 -05:00
|
|
|
if request.method == "POST":
|
2023-02-21 16:59:41 -05:00
|
|
|
session["key"] = request.form.get("apikey")
|
2023-03-09 15:15:42 -05:00
|
|
|
if (any(char in specials for char in session["key"]) or
|
|
|
|
|
re.search(r"[\s]", session["key"])):
|
|
|
|
|
error = "Invalid Key."
|
|
|
|
|
session.clear()
|
|
|
|
|
return render_template("index.html", title="Home", error=error)
|
2023-03-02 17:56:31 -05:00
|
|
|
if session["key"] is not None and len(session["key"]) > 10:
|
2023-03-06 09:33:42 -05:00
|
|
|
endpoint = "/v2/properties/school"
|
2023-02-26 22:08:24 -08:00
|
|
|
headers = {"accept": "application/json", "X-Api-Key": session["key"]}
|
2023-03-07 14:56:01 -05:00
|
|
|
response = requests.get(url + endpoint, headers=headers)
|
2023-03-01 17:05:16 -05:00
|
|
|
return key_response(response)
|
2023-03-02 17:56:31 -05:00
|
|
|
error = "Hm. That doesn't seem right"
|
2023-03-09 15:15:42 -05:00
|
|
|
session.clear()
|
2023-03-02 17:56:31 -05:00
|
|
|
return render_template("index.html", title="Home", error=error)
|
2023-03-09 15:15:42 -05:00
|
|
|
session.clear()
|
2023-03-02 17:56:31 -05:00
|
|
|
return render_template("index.html", title="Home")
|
2023-02-17 16:59:42 -05:00
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-07 09:59:27 -05:00
|
|
|
@app.route("/", methods=["GET", "POST"])
|
2023-03-06 09:33:42 -05:00
|
|
|
def render_home():
|
2023-03-07 14:56:01 -05:00
|
|
|
if session.get("key"):
|
2023-03-09 15:15:42 -05:00
|
|
|
return render_template("bulk_add.html", title="Home")
|
2023-03-06 09:33:42 -05:00
|
|
|
return render_template("index.html", title="Enter Key")
|
|
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-09 15:15:42 -05:00
|
|
|
#@app.route("/options", methods=["GET", "POST"])
|
|
|
|
|
#@app.route("/bulk_add", methods=["GET", "POST"])
|
|
|
|
|
@app.route("/clear_session", methods=["GET", "POST"])
|
2023-03-07 09:59:27 -05:00
|
|
|
def clear_session():
|
2023-03-09 15:15:42 -05:00
|
|
|
if session.get("key"):
|
|
|
|
|
print("Session Formula")
|
|
|
|
|
# [session.pop(key) for key in list(session.keys())]
|
|
|
|
|
session.clear()
|
|
|
|
|
error="Session Cleared!"
|
|
|
|
|
return render_template("index.html", error=error, title="Home, New session")
|
2023-03-07 09:59:27 -05:00
|
|
|
return render_template("index.html", title="Home, New session")
|
|
|
|
|
|
|
|
|
|
|
2023-03-08 16:11:32 -05:00
|
|
|
@app.route("/table")
|
|
|
|
|
def table():
|
|
|
|
|
return render_template("table.html", tables=[session["dfhtml"]], titles=["Table"])
|
|
|
|
|
|
|
|
|
|
@app.route("/upload_file", methods=["GET", "POST"])
|
|
|
|
|
def upload_file():
|
2023-03-07 14:56:01 -05:00
|
|
|
print("Uploading CSV")
|
|
|
|
|
if request.method == "POST":
|
|
|
|
|
if "file" not in request.files:
|
|
|
|
|
flash("No file found or uploaded")
|
2023-03-08 16:11:32 -05:00
|
|
|
return redirect(url_for("bulk_add_opts"))
|
2023-03-07 14:56:01 -05:00
|
|
|
file = request.files["file"]
|
|
|
|
|
if file.filename == "":
|
|
|
|
|
print("no file exists")
|
|
|
|
|
flash("No file found or uploaded")
|
2023-03-08 16:11:32 -05:00
|
|
|
return redirect(url_for("bulk_add_opts"))
|
|
|
|
|
# return redirect(request.url)
|
2023-03-03 20:47:37 -05:00
|
|
|
if file and allowed_file(file.filename):
|
|
|
|
|
filename = secure_filename(file.filename)
|
2023-03-07 14:56:01 -05:00
|
|
|
file_path = os.path.join(app.config["UPLOAD_FOLDER"], filename)
|
2023-03-09 15:15:42 -05:00
|
|
|
session["file"] = filename
|
2023-03-07 14:56:01 -05:00
|
|
|
session["filepath"] = file_path
|
2023-03-03 20:47:37 -05:00
|
|
|
file.save(file_path)
|
2023-03-08 16:11:32 -05:00
|
|
|
file = list(csv.reader(open(file_path, "r")))
|
2023-03-09 15:15:42 -05:00
|
|
|
return divide_values(file)
|
|
|
|
|
return render_template("bulk_add.html", title="Bulk Add")
|
|
|
|
|
|
|
|
|
|
def divide_values(file):
|
|
|
|
|
emails = []
|
|
|
|
|
groups = []
|
|
|
|
|
selection = request.form.get('learner-groups')
|
|
|
|
|
if request.form['submit']:
|
|
|
|
|
if selection == "all-groups":
|
|
|
|
|
for item in file[1:]:
|
|
|
|
|
emails.append(item[0])
|
|
|
|
|
groups.append(item[1:])
|
|
|
|
|
# FEAT: These two extract the groups and emails into two lists
|
|
|
|
|
groups = [item for group in groups for item in group]
|
|
|
|
|
groups = list(set(groups))
|
|
|
|
|
print(emails)
|
|
|
|
|
print(groups)
|
|
|
|
|
return api_csv_parse(emails, groups)
|
|
|
|
|
# We're good here. This can now be sent to the api functions with emails and groups.
|
|
|
|
|
elif selection == "some-groups":
|
|
|
|
|
submissions = []
|
|
|
|
|
for item in file[1:]:
|
|
|
|
|
# FEAT: This extracts each row as a list. Perfect for Learners in Specific Groups.
|
|
|
|
|
submissions.append(item)
|
|
|
|
|
for item in submissions:
|
|
|
|
|
emails.append(item[0])
|
|
|
|
|
print(type(emails))
|
|
|
|
|
groups = item[1:]
|
|
|
|
|
return api_csv_parse(emails, groups)
|
|
|
|
|
return emails
|
|
|
|
|
|
|
|
|
|
if request.form['preview']:
|
|
|
|
|
error="Preview Button Still Under Construction. Try again later."
|
|
|
|
|
return render_template("bulk_add.html", error=error, title="Preview Not Yet")
|
|
|
|
|
|
|
|
|
|
return render_template(
|
|
|
|
|
"bulk_add.html", title="Uploaded File"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def api_csv_parse(emails, groups):
|
|
|
|
|
if emails and groups:
|
|
|
|
|
return api_add_ppl_groups(emails, groups)
|
|
|
|
|
elif emails:
|
|
|
|
|
return api_add_ppl(emails)
|
|
|
|
|
elif groups:
|
|
|
|
|
return api_add_groups(groups)
|
|
|
|
|
return render_template("bulk_add.html", table=htmlcsv, title="CSV Submission")
|
2023-03-08 16:11:32 -05:00
|
|
|
|
2023-03-09 15:15:42 -05:00
|
|
|
def api_csv_all_groups(emails, groups):
|
2023-03-08 16:11:32 -05:00
|
|
|
if emails and groups:
|
|
|
|
|
return api_add_ppl_groups(emails, groups)
|
|
|
|
|
elif emails:
|
|
|
|
|
return api_add_ppl(emails)
|
|
|
|
|
elif groups:
|
|
|
|
|
return api_add_groups(groups)
|
|
|
|
|
return render_template("bulk_add.html", table=htmlcsv, title="CSV Submission")
|
|
|
|
|
|
2023-03-09 15:15:42 -05:00
|
|
|
def api_csv_some_groups(emails, groups):
|
2023-03-08 16:11:32 -05:00
|
|
|
htmlcsv = csvData.to_html()
|
|
|
|
|
|
|
|
|
|
emails = csvData['Email'].values.tolist()
|
|
|
|
|
emails = [nan for nan in emails if str(nan) != 'nan']
|
|
|
|
|
|
|
|
|
|
groups = csvData['Groups'].values.tolist()
|
|
|
|
|
groups = [nan for nan in groups if str(nan) != 'nan']
|
2023-02-27 16:04:19 -05:00
|
|
|
|
2023-03-08 16:11:32 -05:00
|
|
|
print(emails)
|
|
|
|
|
print(groups)
|
|
|
|
|
|
|
|
|
|
# print(email)
|
|
|
|
|
# return groups
|
|
|
|
|
# row_list = csvData.loc[2, :].values.flatten().tolist()
|
|
|
|
|
|
|
|
|
|
return htmlcsv
|
2023-02-27 16:04:19 -05:00
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
@app.route("/bulk_add_opts", methods=["GET", "POST"])
|
|
|
|
|
def bulk_add_opts():
|
2023-03-08 16:11:32 -05:00
|
|
|
return render_template("bulk_add.html", titles="Bulk Add Options")
|
|
|
|
|
|
|
|
|
|
'''
|
2023-02-22 06:42:26 -05:00
|
|
|
array = []
|
2023-02-22 17:11:14 -05:00
|
|
|
dict_response = {}
|
2023-03-02 17:56:31 -05:00
|
|
|
dataframe = pd.DataFrame()
|
|
|
|
|
count = 0
|
|
|
|
|
|
2023-02-22 06:42:26 -05:00
|
|
|
if request.method == "POST":
|
2023-03-07 14:56:01 -05:00
|
|
|
if session.get("file"):
|
2023-03-08 16:11:32 -05:00
|
|
|
pass
|
|
|
|
|
#print("file exists! uploading data...")
|
|
|
|
|
#return "File Exists! Test Complete"
|
2023-03-06 09:33:42 -05:00
|
|
|
while True:
|
|
|
|
|
count += 1
|
|
|
|
|
endpoint = f"v2/groups?page={count}"
|
|
|
|
|
headers = {"accept": "application/json", "X-Api-Key": session["key"]}
|
2023-03-07 14:56:01 -05:00
|
|
|
response = requests.get(url + endpoint, headers=headers)
|
2023-03-06 09:33:42 -05:00
|
|
|
data = response.json()
|
|
|
|
|
nextlink = data["links"]
|
|
|
|
|
|
|
|
|
|
for response in data["data"]:
|
|
|
|
|
uuid = response["id"]
|
|
|
|
|
dict_response = {"id": uuid}
|
|
|
|
|
for keys, values in response["attributes"].items():
|
|
|
|
|
dict_response[keys] = values
|
|
|
|
|
array.append(dict_response)
|
2023-03-08 16:11:32 -05:00
|
|
|
dataframe = pd.DataFrame(array).drop(
|
|
|
|
|
"group_enrollment_link", axis=1
|
|
|
|
|
)
|
2023-03-06 09:33:42 -05:00
|
|
|
print(dataframe)
|
|
|
|
|
|
|
|
|
|
if "next" not in nextlink:
|
|
|
|
|
break
|
|
|
|
|
|
2023-03-08 16:11:32 -05:00
|
|
|
dfgroups = dataframe.to_html()
|
2023-03-06 09:33:42 -05:00
|
|
|
session["dfcsv"] = dataframe.to_csv()
|
2023-03-08 16:11:32 -05:00
|
|
|
return render_template("bulk_add.html", table=dfgroups, titles="Bulk Add")
|
2023-03-06 09:33:42 -05:00
|
|
|
else:
|
|
|
|
|
return "This isn't working. Let's go our own way."
|
2023-03-08 16:11:32 -05:00
|
|
|
'''
|
2023-03-07 14:56:01 -05:00
|
|
|
|
|
|
|
|
@app.route("/bulk_add", methods=["GET", "POST"])
|
|
|
|
|
def bulk_add():
|
2023-02-21 16:59:41 -05:00
|
|
|
if request.method == "POST":
|
|
|
|
|
emails = request.form.get("emails")
|
|
|
|
|
groups = request.form.get("groups")
|
2023-03-07 14:56:01 -05:00
|
|
|
if emails:
|
|
|
|
|
if "\n" in emails:
|
|
|
|
|
emails = emails.split("\n")
|
|
|
|
|
emails = [email.strip() for email in emails]
|
2023-03-08 16:11:32 -05:00
|
|
|
emails = [re.sub(r"[,]", "", email) for email in emails]
|
2023-03-07 14:56:01 -05:00
|
|
|
elif "," in emails:
|
|
|
|
|
emails = emails.split(",")
|
|
|
|
|
emails = [email.strip() for email in emails]
|
2023-03-07 21:35:44 -05:00
|
|
|
else:
|
2023-03-08 16:11:32 -05:00
|
|
|
emails = emails.split()
|
|
|
|
|
else:
|
|
|
|
|
emails = []
|
|
|
|
|
emails.append(emails)
|
2023-03-07 14:56:01 -05:00
|
|
|
if groups:
|
|
|
|
|
if "\n" in groups:
|
2023-03-07 17:52:36 -05:00
|
|
|
groups = groups.split("\n")
|
2023-03-07 14:56:01 -05:00
|
|
|
groups = [group.strip() for group in groups]
|
2023-03-08 16:11:32 -05:00
|
|
|
groups = [re.sub(r"[,]", "", group) for group in groups]
|
2023-03-07 14:56:01 -05:00
|
|
|
elif "," in groups:
|
2023-03-07 17:52:36 -05:00
|
|
|
groups = groups.split(",")
|
2023-03-07 14:56:01 -05:00
|
|
|
groups = [group.strip() for group in groups]
|
2023-03-07 21:35:44 -05:00
|
|
|
else:
|
2023-03-08 16:11:32 -05:00
|
|
|
groups = groups.split()
|
|
|
|
|
else:
|
|
|
|
|
groups = []
|
|
|
|
|
groups.append(groups)
|
2023-03-07 21:35:44 -05:00
|
|
|
|
|
|
|
|
if emails and groups:
|
|
|
|
|
return api_add_ppl_groups(emails, groups)
|
|
|
|
|
elif emails:
|
|
|
|
|
return api_add_ppl(emails)
|
|
|
|
|
elif groups:
|
|
|
|
|
return api_add_groups(groups)
|
2023-03-08 16:11:32 -05:00
|
|
|
return render_template("bulk_add.html")
|
2023-03-07 14:56:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# for group in groups:
|
|
|
|
|
# groupdict = {}
|
2023-03-07 17:52:36 -05:00
|
|
|
# groupdict["name"] = group
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-07 21:35:44 -05:00
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
def api_add_ppl(emails):
|
2023-03-08 16:11:32 -05:00
|
|
|
payload2 = []
|
2023-03-07 21:35:44 -05:00
|
|
|
endpoint = "v2/bulk/people"
|
2023-03-08 16:11:32 -05:00
|
|
|
for email in emails:
|
|
|
|
|
payload2.append({"email": email })
|
|
|
|
|
payload = {"data": {"attributes": {"people": payload2 }}}
|
2023-03-07 21:35:44 -05:00
|
|
|
headers = {
|
|
|
|
|
"accept": "application/json",
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
"X-Api-Key": session["key"],
|
|
|
|
|
}
|
2023-03-08 16:11:32 -05:00
|
|
|
return payload
|
|
|
|
|
# response = requests.post(url + endpoint, json=payload, headers=headers)
|
|
|
|
|
# return check_response(response)
|
2023-03-07 14:56:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def api_add_groups(groups):
|
2023-03-08 16:11:32 -05:00
|
|
|
payload2 = []
|
2023-03-07 21:35:44 -05:00
|
|
|
endpoint = "v2/bulk/people"
|
2023-03-08 16:11:32 -05:00
|
|
|
for group in groups:
|
|
|
|
|
payload2.append({"groups" : group })
|
|
|
|
|
payload = {"data": {"attributes": {"people": payload2 }}}
|
2023-03-07 21:35:44 -05:00
|
|
|
headers = {
|
|
|
|
|
"accept": "application/json",
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
"X-Api-Key": session["key"],
|
|
|
|
|
}
|
2023-03-08 16:11:32 -05:00
|
|
|
return payload
|
|
|
|
|
# response = requests.post(url + endpoint, json=payload, headers=headers)
|
|
|
|
|
# return check_response(response)
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-02 17:56:31 -05:00
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
def api_add_ppl_groups(emails, groups):
|
2023-03-08 16:11:32 -05:00
|
|
|
payload2 = []
|
|
|
|
|
endpoint = "v2/bulk/people"
|
|
|
|
|
combinations = list(itertools.product(emails, groups))
|
|
|
|
|
for combo in combinations:
|
|
|
|
|
payload2.append({"email": combo[0], "groups": combo[1]})
|
|
|
|
|
payload = {
|
|
|
|
|
"data": {"attributes": {"people": payload2 }}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
headers = {
|
|
|
|
|
"accept": "application/json",
|
|
|
|
|
"content-type": "application/json",
|
|
|
|
|
"X-Api-Key": session["key"],
|
|
|
|
|
}
|
|
|
|
|
return payload
|
|
|
|
|
#response = requests.post(url + endpoint, json=payload, headers=headers)
|
|
|
|
|
#return check_response(response)
|
|
|
|
|
|
2023-03-07 17:52:36 -05:00
|
|
|
|
2023-03-07 21:35:44 -05:00
|
|
|
def check_response(response):
|
2023-03-07 17:52:36 -05:00
|
|
|
response = str(response)
|
|
|
|
|
if "202" in response:
|
|
|
|
|
error = "Success! People have been added successfully."
|
2023-03-07 21:35:44 -05:00
|
|
|
return render_template("bulk_add.html", title="People Added", error=error)
|
2023-03-07 17:52:36 -05:00
|
|
|
elif "403" in response:
|
|
|
|
|
error = "Uh oh. Looks like you don't have appropriate privileges."
|
2023-03-07 21:35:44 -05:00
|
|
|
return render_template("bulk_add.html", error=error)
|
2023-03-07 17:52:36 -05:00
|
|
|
elif "422" in response:
|
2023-03-07 21:35:44 -05:00
|
|
|
error = "Hm. Looks like something was wrong with the data you added."
|
|
|
|
|
return render_template("bulk_add.html", error=error)
|
2023-03-07 17:52:36 -05:00
|
|
|
else:
|
|
|
|
|
error = "Shrug"
|
2023-03-07 21:35:44 -05:00
|
|
|
return render_template("bulk_add.html", title="Shrug", errors=error)
|
2023-03-07 14:56:01 -05:00
|
|
|
|
2023-03-08 16:11:32 -05:00
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
@app.route("/templates", methods=["GET", "POST"])
|
|
|
|
|
def templates():
|
|
|
|
|
pass
|
2023-02-22 17:11:14 -05:00
|
|
|
|
2023-02-27 16:04:19 -05:00
|
|
|
|
2023-03-07 09:59:27 -05:00
|
|
|
@app.route("/bulk_courses_to_groups", methods=["GET", "POST"])
|
|
|
|
|
def bulk_courses_to_groups():
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/bulk_invite_ppl", methods=["GET", "POST"])
|
|
|
|
|
def bulk_invite_ppl():
|
|
|
|
|
pass
|
|
|
|
|
|
2023-03-07 14:56:01 -05:00
|
|
|
|
|
|
|
|
# @app.teardown_request
|
|
|
|
|
# def clear_session():
|
2023-03-07 09:59:27 -05:00
|
|
|
# session.clear()
|
2023-02-27 16:04:19 -05:00
|
|
|
|
2023-02-17 16:59:42 -05:00
|
|
|
app.secret_key = "@&I\x1a?\xce\x94\xbb0w\x17\xbf&Y\xa2\xc2(A\xf5\xf2\x97\xba\xeb\xfa"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
ask_key()
|