From 4d5d735c76f7e774e9c8b41eced49a8abbfa9c8b Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Fri, 20 Jan 2023 03:38:34 +0000 Subject: Merged r22066 from trunk to 4.2-stable (#38063). git-svn-id: https://svn.redmine.org/redmine/branches/4.2-stable@22068 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/application_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 06bf0c786..c1a5b8e9f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -344,9 +344,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