From 5effa0a6d62f531f20a5fa2fb16ffc1758d6e62c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 10 Jun 2018 15:42:35 +0100 Subject: [PATCH] Avoid losing filter settings when an invalid user is entered --- app/controllers/issues_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index deec96b7a..a8eeee8b3 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -22,7 +22,8 @@ class IssuesController < ApplicationController if @find_user @issues = @issues.where(:reported_user_id => @find_user.id) else - notice = t("issues.index.user_not_found") + @issues = @issues.none + flash.now[:warning] = t("issues.index.user_not_found") end end @@ -34,8 +35,6 @@ class IssuesController < ApplicationController last_updated_by = params[:last_updated_by].to_s == "nil" ? nil : params[:last_updated_by].to_i @issues = @issues.where(:updated_by => last_updated_by) end - - redirect_to issues_path, :notice => notice if notice end def show -- 2.39.5