summaryrefslogtreecommitdiff
path: root/lib/gitlab/github_import
diff options
context:
space:
mode:
authorAdam Niedzielski <adamsunday@gmail.com>2016-10-28 11:31:45 +0200
committerAdam Niedzielski <adamsunday@gmail.com>2016-10-28 11:31:45 +0200
commite2c603696a9647c15cd154156f13d0e203a930f1 (patch)
tree22f64b82526f74fabb9009db8f6932c4e8d74d12 /lib/gitlab/github_import
parent20a7db4483904c7280093a0309a63dfd1b7ef72e (diff)
downloadgitlab-ce-e2c603696a9647c15cd154156f13d0e203a930f1.tar.gz
Pass user instance to Labels::FindOrCreateService or skip_authorization: trueadam-fix-labels-find-or-create
Do not pass project.owner because it may return a group and Labels::FindOrCreateService throws an error in this case. Fixes #23694.
Diffstat (limited to 'lib/gitlab/github_import')
-rw-r--r--lib/gitlab/github_import/label_formatter.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/github_import/label_formatter.rb b/lib/gitlab/github_import/label_formatter.rb
index 942dfb3312b..e572bb338ce 100644
--- a/lib/gitlab/github_import/label_formatter.rb
+++ b/lib/gitlab/github_import/label_formatter.rb
@@ -15,8 +15,8 @@ module Gitlab
def create!
params = attributes.except(:project)
- service = ::Labels::FindOrCreateService.new(project.owner, project, params)
- label = service.execute
+ service = ::Labels::FindOrCreateService.new(nil, project, params)
+ label = service.execute(skip_authorization: true)
raise ActiveRecord::RecordInvalid.new(label) unless label.persisted?