Commit 7ee732ac authored by Vitali Tatarintev's avatar Vitali Tatarintev

Simplify project_without_auth method

parent a5a2a97a
......@@ -17,12 +17,8 @@ module Projects
private
def project_without_auth
return @project if @project
namespace = params[:namespace_id]
id = params[:project_id]
@project = Project.find_by_full_path("#{namespace}/#{id}")
@project ||= Project
.find_by_full_path("#{params[:namespace_id]}/#{params[:project_id]}")
end
def check_generic_alert_endpoint_feature_flag!
......
......@@ -127,12 +127,8 @@ module Projects
end
def project_without_auth
return @project if @project
namespace = params[:namespace_id]
id = params[:project_id]
@project = Project.find_by_full_path("#{namespace}/#{id}")
@project ||= Project
.find_by_full_path("#{params[:namespace_id]}/#{params[:project_id]}")
end
def prometheus_alerts
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment