Skip to content

Commit

Permalink
Retrieve schedule record using params[:id] since @edit does not exist
Browse files Browse the repository at this point in the history
Schedule Editor is converted to Angular therefore @edit does not exist

https://bugzilla.redhat.com/show_bug.cgi?id=1202571
  • Loading branch information
AparnaKarve committed Jun 4, 2015
1 parent 1711ba7 commit c53c7b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions vmdb/app/controllers/ops_controller/settings/schedules.rb
Expand Up @@ -36,15 +36,14 @@ def schedule_edit
assert_privileges("schedule_edit")
case params[:button]
when "cancel"
@schedule = MiqSchedule.find_by_id(session[:edit][:sched_id]) if session[:edit] && session[:edit][:sched_id]
@schedule = MiqSchedule.find_by_id(params[:id])
if !@schedule || @schedule.id.blank?
add_flash(_("Add of new %s was cancelled by the user") % ui_lookup(:model=>"MiqSchedule"))
else
add_flash(_("Edit of %{model} \"%{name}\" was cancelled by the user") % {:model=>ui_lookup(:model=>"MiqSchedule"), :name=>@schedule.name})
end
get_node_info(x_node)
@schedule = nil
@edit = session[:edit] = nil # clean out the saved info
replace_right_cell(@nodetype)
when "save", "add"
schedule = params[:id] != "new" ? MiqSchedule.find_by_id(params[:id]) : MiqSchedule.new(:userid => session[:userid])
Expand Down

0 comments on commit c53c7b0

Please sign in to comment.