Reformat and don't pass back default parameters to URL
This commit is contained in:
@@ -21,6 +21,7 @@ from core.lib.threshold import (
|
||||
get_chans,
|
||||
get_users,
|
||||
)
|
||||
from core.views import helpers
|
||||
from core.views.ui.tables import DrilldownTable
|
||||
|
||||
# from copy import deepcopy
|
||||
@@ -155,11 +156,6 @@ def drilldown_search(request, return_context=False, template=None):
|
||||
# else:
|
||||
# context = {"object_list": []}
|
||||
|
||||
# Remove null values
|
||||
if "query_full" in query_params:
|
||||
if query_params["query_full"] == "":
|
||||
del query_params["query_full"]
|
||||
|
||||
if "tags" in query_params:
|
||||
if query_params["tags"] == "":
|
||||
del query_params["tags"]
|
||||
@@ -172,7 +168,9 @@ def drilldown_search(request, return_context=False, template=None):
|
||||
|
||||
# Valid sizes
|
||||
context["sizes"] = sizes
|
||||
|
||||
print("BEFORE REMOVE DEFAULT", query_params)
|
||||
helpers.remove_defaults(query_params)
|
||||
print("AFTER REMOVE DEFAULT", query_params)
|
||||
url_params = urllib.parse.urlencode(query_params)
|
||||
context["client_uri"] = url_params
|
||||
context["params"] = query_params
|
||||
@@ -199,17 +197,6 @@ def drilldown_search(request, return_context=False, template=None):
|
||||
clean_url_params = urllib.parse.urlencode(clean_params)
|
||||
context["uri"] = clean_url_params
|
||||
|
||||
# Warn users trying to use query string that the simple query supersedes it
|
||||
if all([x in query_params for x in ["query", "query_full"]]):
|
||||
context["message"] = (
|
||||
"You are searching with both query types. "
|
||||
"The simple query will be used. "
|
||||
"The full query will be ignored. "
|
||||
"Remove the text from the simple query if you wish "
|
||||
"to use the full query."
|
||||
)
|
||||
context["class"] = "warning"
|
||||
|
||||
# unique = str(uuid.uuid4())[:8]
|
||||
if return_context:
|
||||
return context
|
||||
|
||||
Reference in New Issue
Block a user