From: Jan Provaznik jprovazn@redhat.com
Added check that some realm is selected --- src/app/controllers/admin/realms_controller.rb | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/app/controllers/admin/realms_controller.rb b/src/app/controllers/admin/realms_controller.rb index dee6752..f11b69d 100644 --- a/src/app/controllers/admin/realms_controller.rb +++ b/src/app/controllers/admin/realms_controller.rb @@ -44,8 +44,12 @@ class Admin::RealmsController < ApplicationController end
def multi_destroy - require_privilege(Privilege::MODIFY, Realm) - FrontendRealm.destroy(params[:id]) + if params[:id].blank? + flash[:error] = 'You must select some realm first.' + else + require_privilege(Privilege::MODIFY, Realm) + FrontendRealm.destroy(params[:id]) + end redirect_to admin_realms_path end