Project

General

Profile

« Previous | Next » 

Revision f9bc5a8e

Added by Daniel Lobato Garcia over 10 years ago

fixes #3920 - prevent 500 ScopedSearch errors on the API, raise UI errors correctly

View differences:

app/controllers/hostgroups_controller.rb
before_filter :find_hostgroup, :only => [:edit, :update, :destroy, :clone]
def index
begin
my_groups = User.current.admin? ? Hostgroup : Hostgroup.my_groups
values = my_groups.search_for(params[:search], :order => params[:order])
rescue => e
error e.to_s
values = my_groups.search_for ""
end
@hostgroups = values.paginate :page => params[:page]
@hostgroups = Hostgroup.my_groups.search_for(params[:search], :order => params[:order]).paginate(:page => params[:page])
end
def new

Also available in: Unified diff