Revision 107e0ff8
Added by Daniel Lobato Garcia over 10 years ago
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
fixes #2231 - hostgroup deletion is restricted to hostgroups without children
(cherry picked from commit 8c68024ac619121312680ee8afc467857155e71d)