From e7bfab6f4309b83dd5e195d2acbb4f196035c462 Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 20 Jan 2023 03:32:40 +0000 Subject: Merged r22066 from trunk to 5.0-stable (#38063). git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@22067 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/application_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index d400bdca8..2c070ed67 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -354,9 +354,12 @@ class ApplicationController < ActionController::Base # and authorize the user for the requested action def find_optional_project if params[:project_id].present? - find_project(params[:project_id]) + @project = Project.find(params[:project_id]) end authorize_global + rescue ActiveRecord::RecordNotFound + User.current.logged? ? render_404 : require_login + false end # Finds and sets @project based on @object.project -- cgit v1.2.3