Skip to content

Commit

Permalink
Merge pull request #12812 from jzigmund/bz1392770-cant_create_alert
Browse files Browse the repository at this point in the history
Fix Alert creation after delete the other one
(cherry picked from commit 138d0d7)

https://bugzilla.redhat.com/show_bug.cgi?id=1405200
  • Loading branch information
h-kataria authored and simaishi committed Jan 9, 2017
1 parent 3fb4e9f commit 78b4dba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/controllers/miq_policy_controller/alerts.rb
Expand Up @@ -60,7 +60,7 @@ def alert_delete
else
alerts.push(params[:id])
end
alert_get_info(MiqAlert.find(params[:id]))
@alert = MiqAlert.find(params[:id])
alert_sync_provider(:delete)

process_alerts(alerts, "destroy") unless alerts.empty?
Expand Down Expand Up @@ -235,7 +235,8 @@ def alert_build_edit_screen
# skip record id when copying attributes
@alert = MiqAlert.find(params[:id]).dup
else
@alert = params[:id] ? MiqAlert.find(params[:id]) : MiqAlert.new # Get existing or new record
# Get existing record if edit action or create new record
@alert = params[:id] ? MiqAlert.find(params[:id]) : MiqAlert.new
@alert.enabled = true unless @alert.id # Default enabled to true if new record
end
@edit[:key] = "alert_edit__#{@alert.id || "new"}"
Expand Down

0 comments on commit 78b4dba

Please sign in to comment.