Merge branch 'sh-github-importer-improve-error' into 'master'
GitHub Rake importer: Fail with a clearer explanation if GitLab username is wrong See merge request gitlab-org/gitlab-ce!19653
This commit is contained in:
commit
fa1a75ae28
1 changed files with 4 additions and 1 deletions
|
@ -9,7 +9,10 @@ class GithubImport
|
||||||
def initialize(token, gitlab_username, project_path, extras)
|
def initialize(token, gitlab_username, project_path, extras)
|
||||||
@options = { token: token }
|
@options = { token: token }
|
||||||
@project_path = project_path
|
@project_path = project_path
|
||||||
@current_user = User.find_by_username(gitlab_username)
|
@current_user = User.find_by(username: gitlab_username)
|
||||||
|
|
||||||
|
raise "GitLab user #{gitlab_username} not found. Please specify a valid username." unless @current_user
|
||||||
|
|
||||||
@github_repo = extras.empty? ? nil : extras.first
|
@github_repo = extras.empty? ? nil : extras.first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue