Welcome to mirror list, hosted at ThFree Co, Russian Federation.

base_controller.rb « import « controllers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c84fc2d305d48dbb4a398ee226a21286130765aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Import::BaseController < ApplicationController
  private

  def find_or_create_namespace(names, owner)
    names = params[:target_namespace].presence || names

    return current_user.namespace if names == owner

    group = Groups::NestedCreateService.new(current_user, group_path: names).execute

    group.errors.any? ? current_user.namespace : group
  rescue => e
    Gitlab::AppLogger.error(e)

    current_user.namespace
  end
end