Skip to content

Commit

Permalink
allow to see saved reports after linked MiqTask deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Jun 5, 2017
1 parent 68be6c6 commit 308fa6f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/controllers/report_controller/saved_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def fetch_saved_report(id)
{:name => "#{rr.name} - #{format_timezone(rr.created_on, Time.zone, "gt")}"}
if admin_user? || current_user.miq_group_ids.include?(rr.miq_group_id)
@report_result_id = session[:report_result_id] = rr.id
@report_result = rr
session[:report_result_runtime] = rr.last_run_on
task = MiqTask.find_by_id(rr.miq_task_id)
if task && MiqTask.status_ok?(task.status)
if rr.status.downcase == "complete"
@report = rr.report_results
session[:rpt_task_id] = nil
if @report.blank?
Expand Down Expand Up @@ -77,8 +77,6 @@ def fetch_saved_report(id)
add_flash(_("No records found for this report"), :warning)
end
end
else # report is queued/running/error
@report_result = rr
end
else
add_flash(_("Report is not authorized for the logged in user"), :error)
Expand Down

0 comments on commit 308fa6f

Please sign in to comment.