Skip to content
Snippets Groups Projects
Commit 80c4f109 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre
Browse files

Don't touch Issue/Merge Request when importing GitHub comments

parent 52daddc0
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -152,12 +152,14 @@ module Gitlab
end
 
def create_comments(issuable, comments)
comments.each do |raw|
begin
comment = CommentFormatter.new(project, raw)
issuable.notes.create!(comment.attributes)
rescue => e
errors << { type: :comment, url: Gitlab::UrlSanitizer.sanitize(raw.url), errors: e.message }
ActiveRecord::Base.no_touching do
comments.each do |raw|
begin
comment = CommentFormatter.new(project, raw)
issuable.notes.create!(comment.attributes)
rescue => e
errors << { type: :comment, url: Gitlab::UrlSanitizer.sanitize(raw.url), errors: e.message }
end
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment