Skip to content

Commit

Permalink
[api] allow to revoke maintenance_incidents no matter what
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Apr 22, 2013
1 parent 9808967 commit fe98d96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/app/controllers/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -815,16 +815,19 @@ def command_changestate
incident_project = nil
req.bs_request_actions.each do |action|
if action.action_type == :maintenance_incident
tprj = Project.get_by_name action.target_project

if params[:cmd] == "setincident"
tprj = Project.get_by_name action.target_project

# use an existing incident
if tprj.project_type.to_s == "maintenance"
tprj = Project.get_by_name(action.target_project + ":" + params[:incident])
action.target_project = tprj.name
action.save!
end
elsif params[:cmd] == "changestate" and params[:newstate] == "accepted"
tprj = Project.get_by_name action.target_project

# the accept case, create a new incident if needed
if tprj.project_type.to_s == "maintenance"
# create incident if it is a maintenance project
Expand Down

0 comments on commit fe98d96

Please sign in to comment.