|
|
@ -23,6 +23,12 @@ def escape(obj):
|
|
|
|
return obj
|
|
|
|
return obj
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def sort_data(data):
|
|
|
|
|
|
|
|
for item in data:
|
|
|
|
|
|
|
|
if isinstance(data[item], list):
|
|
|
|
|
|
|
|
data[item].sort()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def threshold_request(url, data):
|
|
|
|
def threshold_request(url, data):
|
|
|
|
headers = {
|
|
|
|
headers = {
|
|
|
|
"ApiKey": settings.THRESHOLD_API_KEY,
|
|
|
|
"ApiKey": settings.THRESHOLD_API_KEY,
|
|
|
@ -46,6 +52,7 @@ def threshold_request(url, data):
|
|
|
|
response = r.json()
|
|
|
|
response = r.json()
|
|
|
|
except JSONDecodeError:
|
|
|
|
except JSONDecodeError:
|
|
|
|
logging.error(f"Invalid JSON response: {r.text}")
|
|
|
|
logging.error(f"Invalid JSON response: {r.text}")
|
|
|
|
|
|
|
|
sort_data(response)
|
|
|
|
return response
|
|
|
|
return response
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|