Fix context menu

This commit is contained in:
2022-09-30 07:22:22 +01:00
parent d8981378bd
commit 5530fd762c
2 changed files with 66 additions and 4 deletions

View File

@@ -12,7 +12,6 @@ from rest_framework.parsers import FormParser
from rest_framework.views import APIView
from core.db.storage import db
from core.lib.context import construct_query
from core.lib.threshold import (
annotate_num_chans,
annotate_num_users,
@@ -361,9 +360,14 @@ class DrilldownContextModal(APIView):
if query_params["type"] not in ["znc", "auth"]:
annotate = True
# Create the query with the context helper
if query_params["num"].isdigit():
query_params["num"] = int(query_params["num"])
search_query = construct_query(
if "num" in query_params:
if query_params["num"]:
if query_params["num"].isdigit():
query_params["num"] = int(query_params["num"])
else:
return {"message": "Invalid num value", "class": "danger"}
search_query = db.construct_context_query(
query_params["index"],
query_params["net"],
query_params["channel"],