From: Tom Hughes Date: Fri, 7 May 2010 13:08:25 +0000 (+0100) Subject: Redirect after processing user changes X-Git-Tag: live~6294^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/1eba0609296c8208fd69062a189371c05ebce11e Redirect after processing user changes After we have processed the requested user changes, redirect back to the list so that the resulting page is reloadable without getting resubmission warnings from the browser. --- diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 5b9f5a0c7..222840a06 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -339,16 +339,18 @@ class UserController < ApplicationController User.update_all("status = 'confirmed'", :id => ids) if params[:confirm] User.update_all("status = 'deleted'", :id => ids) if params[:hide] - end - - conditions = Hash.new - conditions[:status] = params[:status] if params[:status] - conditions[:creation_ip] = params[:ip] if params[:ip] - @user_pages, @users = paginate(:users, - :conditions => conditions, - :order => :id, - :per_page => 50) + redirect_to url_for(:status => params[:status], :ip => params[:ip], :page => params[:page]) + else + conditions = Hash.new + conditions[:status] = params[:status] if params[:status] + conditions[:creation_ip] = params[:ip] if params[:ip] + + @user_pages, @users = paginate(:users, + :conditions => conditions, + :order => :id, + :per_page => 50) + end end private