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

[36521] Saving changes to user profile after handling error message leads to user profile instead of edit user page (#15018)

Henriette Darge89eeb82251c3
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index bb332a60519..ffa56f3e5ec 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -134,7 +134,7 @@ class UsersController < ApplicationController
respond_to do |format|
format.html do
flash[:notice] = I18n.t(:notice_successful_update)
- redirect_back(fallback_location: edit_user_path(@user))
+ render action: :edit
end
end
else
diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb
index ac603f200b3..f211f357f61 100644
--- a/spec/controllers/users_controller_spec.rb
+++ b/spec/controllers/users_controller_spec.rb
@@ -642,7 +642,7 @@ RSpec.describe UsersController do
end
it 'redirects to the edit page' do
- expect(response).to redirect_to(edit_user_url(some_user))
+ expect(response).to render_template :edit
end
it 'is assigned their new values' do