From 6fea1dd5046e4b321565d487a549d8d576e80ea0 Mon Sep 17 00:00:00 2001 From: Benjamin Knapp Date: Fri, 10 Jan 2025 10:56:18 +0100 Subject: [PATCH] groups setup keep http vars for table sort and search SUP-18972 Change-Id: I7d442a2c42f68cc3c5048de50f198fbb9696dffc --- cmk/gui/wato/pages/groups.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/cmk/gui/wato/pages/groups.py b/cmk/gui/wato/pages/groups.py index 6ca446392b2..1a98f77be9a 100644 --- a/cmk/gui/wato/pages/groups.py +++ b/cmk/gui/wato/pages/groups.py @@ -45,7 +45,7 @@ from cmk.gui.utils.csrf_token import check_csrf_token from cmk.gui.utils.html import HTML from cmk.gui.utils.transaction_manager import transactions -from cmk.gui.utils.urls import make_confirm_delete_link, makeactionuri +from cmk.gui.utils.urls import make_confirm_delete_link, makeactionuri, makeuri from cmk.gui.valuespec import ( CascadingDropdown, Dictionary, @@ -143,7 +143,8 @@ def page_menu(self, breadcrumb: Breadcrumb) -> PageMenu: def action(self) -> ActionResult: if not transactions.check_transaction(): - return redirect(mode_url("%s_groups" % self.type_name)) + request.del_var("_transid") + return redirect(makeuri(request=request, addvars=list(request.itervars()))) if request.var("_delete"): delname = request.get_ascii_input_mandatory("_delete") @@ -162,7 +163,11 @@ def action(self) -> ActionResult: groups.delete_group(delname, self.type_name) self._groups = self._load_groups() - return redirect(mode_url("%s_groups" % self.type_name)) + if request.var("mode") == "edit_host_group": + return redirect(mode_url("%s_groups" % self.type_name)) + + request.del_var("_transid") + return redirect(makeuri(request=request, addvars=list(request.itervars()))) def _page_no_groups(self) -> None: html.div(_("No groups are defined yet."), class_="info")