Project

General

Profile

« Previous | Next » 

Revision 8c68024a

Added by Daniel Lobato Garcia over 10 years ago

fixes #2231 - hostgroup deletion is restricted to hostgroups without children

View differences:

app/controllers/api/v2/hostgroups_controller.rb
param :id, :identifier, :required => true
def destroy
process_response @hostgroup.destroy
if @hostgroup.has_children?
render :json => {'message'=> _("Cannot delete group %{current} because it has nested groups.") % { :current => @hostgroup.label } }, :status => :conflict
else
process_response @hostgroup.destroy
end
end
end

Also available in: Unified diff