diff --git a/app/assets/javascripts/miq_application.js b/app/assets/javascripts/miq_application.js index 6f32613b4a7..fbc5fa8fdd4 100644 --- a/app/assets/javascripts/miq_application.js +++ b/app/assets/javascripts/miq_application.js @@ -970,6 +970,10 @@ function miqShowAE_Tree(typ) { // Toggle the user options div in the page header (:onclick from layouts/user_options) function miqChangeGroup(id) { miqSparkleOn(); + + // prevent login redirect once current requests fail after the group gets changed + ManageIQ.logoutInProgress = true; + miqJqueryRequest(miqPassFields('/dashboard/change_group', {to_group: id})); } @@ -1543,7 +1547,7 @@ var fontIconChar = _.memoize(function(klass) { function redirectLogin(msg) { if (ManageIQ.logoutInProgress) { - return; // prevent double redirect after pressing the Logout button + return; // prevent double redirect after pressing the Logout button or when changing group } add_flash(msg, 'warning'); diff --git a/app/assets/javascripts/miq_global.js b/app/assets/javascripts/miq_global.js index 225b94c271f..632db0403cc 100644 --- a/app/assets/javascripts/miq_global.js +++ b/app/assets/javascripts/miq_global.js @@ -48,7 +48,7 @@ if (!window.ManageIQ) { i18n: { mark_translated_strings: false, }, - logoutInProgress: false, // prevent redirectLogin *during* logout + logoutInProgress: false, // prevent redirectLogin *during* logout and group change mouse: { x: null, // mouse X coordinate for popup menu y: null, // mouse Y coordinate for popup menu