return 404 if project not found
This commit is contained in:
parent
f7dd067490
commit
cb32e0320a
2 changed files with 13 additions and 2 deletions
|
@ -5,8 +5,13 @@ module Gitlab
|
|||
end
|
||||
|
||||
def user_project
|
||||
@project ||= current_user.projects.find_by_id(params[:id]) ||
|
||||
current_user.projects.find_by_code(params[:id])
|
||||
if @project ||= current_user.projects.find_by_id(params[:id]) ||
|
||||
current_user.projects.find_by_code(params[:id])
|
||||
else
|
||||
error!({'message' => '404 Not found'}, 404)
|
||||
end
|
||||
|
||||
@project
|
||||
end
|
||||
|
||||
def authenticate!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue