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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-12-16 16:40:38 +0300
committerValery Sizov <valery@gitlab.com>2016-12-16 16:40:38 +0300
commitb0501c34c478a528f2aa7633dfa6d13e9c61af64 (patch)
treeb0d5779c70e71ab1ea22bb42c1b67c61d571c0db /lib/gitlab
parent3b4e81eed50dac796de5720b9975125dc8de609b (diff)
BB importer: address review comment
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/bitbucket_import/importer.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/bitbucket_import/importer.rb b/lib/gitlab/bitbucket_import/importer.rb
index 53c95ea4079..63a4407cb78 100644
--- a/lib/gitlab/bitbucket_import/importer.rb
+++ b/lib/gitlab/bitbucket_import/importer.rb
@@ -28,6 +28,7 @@ module Gitlab
def handle_errors
return unless errors.any?
+
project.update_column(:import_error, {
message: 'The remote data could not be fully imported.',
errors: errors
@@ -35,15 +36,12 @@ module Gitlab
end
def gitlab_user_id(project, username)
- if username
- user = find_user(username)
- (user && user.id) || project.creator_id
- else
- project.creator_id
- end
+ user = find_user(username)
+ user.try(:id) || project.creator_id
end
def find_user(username)
+ return nil unless username
User.joins(:identities).find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", username)
end