Skip to content

Commit

Permalink
Fix report schedule deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
mzazrivec committed Oct 17, 2017
1 parent 83ed40f commit c1b4007
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions app/controllers/report_controller/schedules.rb
Expand Up @@ -75,13 +75,8 @@ def schedule_new
def miq_report_schedule_delete
assert_privileges("miq_report_schedule_delete")
scheds = find_checked_records_with_rbac(MiqSchedule)
if params[:id]
if MiqSchedule.exists?(from_cid(params[:id]))
scheds.push(from_cid(params[:id]))
else
add_flash(_("%{model} no longer exists") % {:model => ui_lookup(:model => "MiqSchedule")}, :error)
end
end
scheds = [find_record_with_rbac(MiqSchedule, params[:id])] if scheds.empty? && params[:id] # sched. summary screen
add_flash(_("Schedule is not available or no longer exists"), :error) if scheds.empty?
single_name = scheds.first.name if scheds.length == 1
process_schedules(scheds, "destroy") unless scheds.empty?
unless flash_errors?
Expand Down

0 comments on commit c1b4007

Please sign in to comment.