diff --git a/cmk/gui/wato/pages/groups.py b/cmk/gui/wato/pages/groups.py index 34e1265054c..c7fa7198227 100644 --- a/cmk/gui/wato/pages/groups.py +++ b/cmk/gui/wato/pages/groups.py @@ -47,7 +47,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 makeactionuri +from cmk.gui.utils.urls import makeactionuri, makeuri from cmk.gui.valuespec import ( CascadingDropdown, Dictionary, @@ -135,7 +135,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") @@ -154,7 +155,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")