Commit 702b46ae authored by Jan Provaznik's avatar Jan Provaznik

Merge branch 'cablett-rename-confusing-project-namespace-method' into 'master'

Rename confusing method for clarity

See merge request gitlab-org/gitlab!73799
parents 61ea24bf 3d69a322
...@@ -45,7 +45,7 @@ module Projects ...@@ -45,7 +45,7 @@ module Projects
if namespace_id if namespace_id
# Find matching namespace and check if it allowed # Find matching namespace and check if it allowed
# for current user if namespace_id passed. # for current user if namespace_id passed.
unless current_user.can?(:create_projects, project_namespace) unless current_user.can?(:create_projects, parent_namespace)
@project.namespace_id = nil @project.namespace_id = nil
deny_namespace deny_namespace
return @project return @project
...@@ -227,14 +227,14 @@ module Projects ...@@ -227,14 +227,14 @@ module Projects
def extra_attributes_for_measurement def extra_attributes_for_measurement
{ {
current_user: current_user&.name, current_user: current_user&.name,
project_full_path: "#{project_namespace&.full_path}/#{@params[:path]}" project_full_path: "#{parent_namespace&.full_path}/#{@params[:path]}"
} }
end end
private private
def project_namespace def parent_namespace
@project_namespace ||= Namespace.find_by_id(@params[:namespace_id]) || current_user.namespace @parent_namespace ||= Namespace.find_by_id(@params[:namespace_id]) || current_user.namespace
end end
def create_from_template? def create_from_template?
......
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