summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-20 03:32:40 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-20 03:32:40 +0000
commite7bfab6f4309b83dd5e195d2acbb4f196035c462 (patch)
treecace1be9e29b0c21533ae81114f02659b8b95d26 /app/controllers
parentf9f617caa3dab03d4594b826effe171d65f77338 (diff)
downloadredmine-e7bfab6f4309b83dd5e195d2acbb4f196035c462.tar.gz
redmine-e7bfab6f4309b83dd5e195d2acbb4f196035c462.zip
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
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/application_controller.rb5
1 files changed, 4 insertions, 1 deletions
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