X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/fbe529d87e61ab63bcf749067422ab2cbbb655d0..eac7348ad2793cb3ad72c68bef84ff863af92d5f:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index c181da305..5b6222a98 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -287,7 +287,11 @@ class UserController < ApplicationController flash[:warning] = t 'user.make_friend.already_a_friend', :name => name end - redirect_to :controller => 'user', :action => 'view' + if params[:referer] + redirect_to params[:referer] + else + redirect_to :controller => 'user', :action => 'view' + end end end @@ -302,7 +306,11 @@ class UserController < ApplicationController flash[:error] = t 'user.remove_friend.not_a_friend', :name => friend.display_name end - redirect_to :controller => 'user', :action => 'view' + if params[:referer] + redirect_to params[:referer] + else + redirect_to :controller => 'user', :action => 'view' + end end end