Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Redirect to index after report deletion

Alexandere9e15cd7c412
diff --git a/modules/reporting/app/controllers/cost_reports_controller.rb b/modules/reporting/app/controllers/cost_reports_controller.rb
index 71567b53dad..edb12e8baf2 100644
--- a/modules/reporting/app/controllers/cost_reports_controller.rb
+++ b/modules/reporting/app/controllers/cost_reports_controller.rb
@@ -152,7 +152,7 @@ class CostReportsController < ApplicationController
else
raise ActiveRecord::RecordNotFound
end
- redirect_to action: "index", default: 1
+ redirect_to action: "index", default: 1, id: nil
end
##
diff --git a/modules/reporting/spec/controllers/cost_reports_controller_spec.rb b/modules/reporting/spec/controllers/cost_reports_controller_spec.rb
index 8bcd635c228..c8a02d04c3e 100644
--- a/modules/reporting/spec/controllers/cost_reports_controller_spec.rb
+++ b/modules/reporting/spec/controllers/cost_reports_controller_spec.rb
@@ -70,7 +70,7 @@ RSpec.describe CostReportsController do
end
it "redirected" do
- expect(response).to have_http_status(:redirect)
+ expect(response).to redirect_to(cost_reports_url(default: 1))
end
end