diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-12-16 16:56:13 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-12-16 16:56:13 +0300 |
commit | 5e2f68e555105985399d229d7edab8f168b594d1 (patch) | |
tree | 1f213e115e0f43521081468a5a31543d862b93a6 | |
parent | 27f271ee1ed977f8070f528f1d5e21ad577f5409 (diff) | |
parent | fc42f969c460e22a5f2ac2c9a6ec287b7b0f910f (diff) |
Merge branch 'bitbucket-oauth2' of gitlab.com:gitlab-org/gitlab-ce into bitbucket-oauth2
-rw-r--r-- | lib/gitlab/bitbucket_import/importer.rb | 10 |
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 |