diff --git a/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js b/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js index cbd03d80..d8c8b674 100644 --- a/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js +++ b/magnum_ui/static/dashboard/container-infra/cluster-templates/delete/delete.service.js @@ -136,8 +136,11 @@ deleteModalResult.fail.forEach(function markFailed(item) { result.failed(resourceType, getEntity(item).id); }); - if (result.result.failed.length === 0 && result.result.deleted.length > 0) { - $location.path("/project/cluster_templates"); + var indexPath = "/project/cluster_templates"; + var currentPath = $location.path(); + if (result.result.failed.length === 0 && result.result.deleted.length > 0 && + currentPath !== indexPath) { + $location.path(indexPath); } else { return result.result; } diff --git a/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js b/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js index e108ae2d..ccc58f32 100644 --- a/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js +++ b/magnum_ui/static/dashboard/container-infra/clusters/delete/delete.service.js @@ -136,8 +136,11 @@ deleteModalResult.fail.forEach(function markFailed(item) { result.failed(resourceType, getEntity(item).id); }); - if (result.result.failed.length === 0 && result.result.deleted.length > 0) { - $location.path("/project/clusters"); + var indexPath = "/project/clusters"; + var currentPath = $location.path(); + if (result.result.failed.length === 0 && result.result.deleted.length > 0 && + currentPath !== indexPath) { + $location.path(indexPath); } else { return result.result; }