gitlab-org--gitlab-foss/lib/gitlab/import_formatter.rb
Bart Libert 4bfd54f3d2
Import bitbucket issues that are reported by an anonymous user
For these kind of issues, the "reporter" field is present but zero.
In such a case, "fetch" will not return the default value, but it will
return nil.
Hence, importing fails, because the "username" field of nil is referenced

Fixes issue #44381
2018-05-24 13:28:58 +02:00

16 lines
315 B
Ruby

module Gitlab
class ImportFormatter
def comment(author, date, body)
"\n\n*By #{author} on #{date}*\n\n#{body}"
end
def comments_header
"\n\n\n**Imported comments:**\n"
end
def author_line(author)
author ||= "Anonymous"
"*Created by: #{author}*\n\n"
end
end
end