From fe84a7b604dfe3eecbfce062e9d7c7d40b2aaca9 Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Mon, 5 Sep 2022 07:20:30 +0100 Subject: [PATCH] Don't render twice on HTMX requests --- core/static/js/column-shifter.js | 2 ++ core/views/ui/drilldown.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/static/js/column-shifter.js b/core/static/js/column-shifter.js index 6eae15c..b8b3c35 100644 --- a/core/static/js/column-shifter.js +++ b/core/static/js/column-shifter.js @@ -45,6 +45,8 @@ $(document).ready(function(){ "msg_id": "off", "net_id": "off", "user_id": "off", + "nick_id": "off", + "status": "off", "num_users": "off", "num_chans": "off", "exemption": "off", diff --git a/core/views/ui/drilldown.py b/core/views/ui/drilldown.py index d970db4..d5b9b0b 100644 --- a/core/views/ui/drilldown.py +++ b/core/views/ui/drilldown.py @@ -211,14 +211,16 @@ def drilldown_search(request, return_context=False, template=None): context["class"] = "warning" # unique = str(uuid.uuid4())[:8] + if return_context: + return context + response = render(request, template_name, context) if request.GET: if request.htmx: response["HX-Push"] = reverse("home") + "?" + url_params elif request.POST: response["HX-Push"] = reverse("home") + "?" + url_params - if return_context: - return context + return response