summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-20 03:38:34 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-20 03:38:34 +0000
commit4d5d735c76f7e774e9c8b41eced49a8abbfa9c8b (patch)
tree579417316053fcfd79a0e34895ade330407669b0 /app
parent6bd8970afb045e836789679c52b57f6a789c964e (diff)
downloadredmine-4d5d735c76f7e774e9c8b41eced49a8abbfa9c8b.tar.gz
redmine-4d5d735c76f7e774e9c8b41eced49a8abbfa9c8b.zip
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
Diffstat (limited to 'app')
-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 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