Remove some debugging code

This commit is contained in:
Mark Veidemanis 2022-09-06 12:18:58 +01:00
parent e90c151787
commit 9774da0d00
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
3 changed files with 8 additions and 9 deletions

View File

@ -132,7 +132,6 @@ def query_results(
required_any = ["query_full", "query", "tags"]
if not any([field in query_params.keys() for field in required_any]):
if not custom_query:
print("EMPTY QUERY")
message = "Empty query!"
message_class = "warning"
return {"message": message, "class": message_class}
@ -162,12 +161,10 @@ def query_results(
for source_iter in settings.MANTICORE_SOURCES_RESTRICTED:
sources.append(source_iter)
print("BEOFRE ADD TOP", add_top)
add_top_tmp = {"bool": {"should": []}}
for source_iter in sources:
add_top_tmp["bool"]["should"].append({"equals": {"src": source_iter}})
add_top.append(add_top_tmp)
print("AFTER", add_top)
# Date/time range
if set({"from_date", "to_date", "from_time", "to_time"}).issubset(
@ -292,5 +289,4 @@ def query_results(
"card": results["hits"]["total"],
"took": results["took"],
}
print("RTRN", context)
return context

View File

@ -1,7 +1,9 @@
from core.lib.threshold import annotate_num_chans, annotate_num_users, annotate_online
from django.conf import settings
from datetime import datetime
from django.conf import settings
from core.lib.threshold import annotate_num_chans, annotate_num_users, annotate_online
def annotate_results(results_parsed):
"""
@ -147,7 +149,9 @@ def parse_results(results):
if isinstance(element["ts"], str):
ts = element["ts"]
else:
ts = datetime.utcfromtimestamp(element["ts"]).strftime('%Y-%m-%dT%H:%M:%S')
ts = datetime.utcfromtimestamp(element["ts"]).strftime(
"%Y-%m-%dT%H:%M:%S"
)
ts_spl = ts.split("T")
date = ts_spl[0]
time = ts_spl[1]
@ -161,4 +165,4 @@ def parse_results(results):
else:
element["time"] = time
results_parsed.append(element)
return results_parsed
return results_parsed

View File

@ -406,7 +406,6 @@ class DrilldownContextModal(APIView):
# for index, item in enumerate(results["object_list"]):
# results["object_list"][index]["time"] = item["time"]+"SSS"
unique = str(uuid.uuid4())[:8]
print("PARAMS", query_params)
context = {
"net": query_params["net"],
"channel": query_params["channel"],