Commit fa1a75ae authored by James Lopez's avatar James Lopez

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
parents 1dbb20d9 28871d73
...@@ -9,7 +9,10 @@ class GithubImport ...@@ -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
......
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