Commit 5e2f68e5 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'bitbucket-oauth2' of gitlab.com:gitlab-org/gitlab-ce into bitbucket-oauth2

parents 27f271ee fc42f969
...@@ -28,6 +28,7 @@ module Gitlab ...@@ -28,6 +28,7 @@ module Gitlab
def handle_errors def handle_errors
return unless errors.any? return unless errors.any?
project.update_column(:import_error, { project.update_column(:import_error, {
message: 'The remote data could not be fully imported.', message: 'The remote data could not be fully imported.',
errors: errors errors: errors
...@@ -35,15 +36,12 @@ module Gitlab ...@@ -35,15 +36,12 @@ module Gitlab
end end
def gitlab_user_id(project, username) def gitlab_user_id(project, username)
if username user = find_user(username)
user = find_user(username) user.try(:id) || project.creator_id
(user && user.id) || project.creator_id
else
project.creator_id
end
end end
def find_user(username) def find_user(username)
return nil unless username
User.joins(:identities).find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", username) User.joins(:identities).find_by("identities.extern_uid = ? AND identities.provider = 'bitbucket'", username)
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