From 9774da0d0063a2687443eb2c383044d24decda66 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Tue, 6 Sep 2022 12:18:58 +0100 Subject: [PATCH] Remove some debugging code --- core/lib/manticore.py | 4 ---- core/lib/processing.py | 12 ++++++++---- core/views/ui/drilldown.py | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/lib/manticore.py b/core/lib/manticore.py index 9d56104..f3737ec 100644 --- a/core/lib/manticore.py +++ b/core/lib/manticore.py @@ -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 diff --git a/core/lib/processing.py b/core/lib/processing.py index d3607dc..243770e 100644 --- a/core/lib/processing.py +++ b/core/lib/processing.py @@ -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 \ No newline at end of file + return results_parsed diff --git a/core/views/ui/drilldown.py b/core/views/ui/drilldown.py index 77b014d..d970db4 100644 --- a/core/views/ui/drilldown.py +++ b/core/views/ui/drilldown.py @@ -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"],