summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-05-30 09:52:58 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-30 09:52:58 +0000
commit62d96d8854d35121dc5d3b6ff4fe0949be5795d1 (patch)
treeb75b33a083a06c80361f535067a2af190da9bb30 /lib
parent5a81bca825f84ac26e4161bbba30156defee9c65 (diff)
parent4bfd54f3d2e303d751d49834879867f3c62156e9 (diff)
downloadgitlab-ce-62d96d8854d35121dc5d3b6ff4fe0949be5795d1.tar.gz
Merge branch 'fix/bitbucket_import_anonymous' into 'master'
Import bitbucket issues that are reported by an anonymous user Closes #44381 See merge request gitlab-org/gitlab-ce!18199
Diffstat (limited to 'lib')
-rw-r--r--lib/bitbucket/representation/issue.rb2
-rw-r--r--lib/gitlab/import_formatter.rb1
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/bitbucket/representation/issue.rb b/lib/bitbucket/representation/issue.rb
index 054064395c3..44bcbc250b3 100644
--- a/lib/bitbucket/representation/issue.rb
+++ b/lib/bitbucket/representation/issue.rb
@@ -12,7 +12,7 @@ module Bitbucket
end
def author
- raw.fetch('reporter', {}).fetch('username', nil)
+ raw.dig('reporter', 'username')
end
def description
diff --git a/lib/gitlab/import_formatter.rb b/lib/gitlab/import_formatter.rb
index 3e54456e936..4e611e7f16c 100644
--- a/lib/gitlab/import_formatter.rb
+++ b/lib/gitlab/import_formatter.rb
@@ -9,6 +9,7 @@ module Gitlab
end
def author_line(author)
+ author ||= "Anonymous"
"*Created by: #{author}*\n\n"
end
end