fix bad refactoring of import data credentials

This commit is contained in:
James Lopez 2016-05-26 11:25:35 +02:00
parent adc64e4583
commit bf484ffee4

View file

@ -5,9 +5,9 @@ module Gitlab
def initialize(project) def initialize(project)
@project = project @project = project
credentials = project.import_data import_data = project.import_data
if credentials && credentials[:password] if import_data && import_data.credentials && import_data.credentials[:password]
@client = Client.new(credentials[:password]) @client = Client.new(import_data.credentials[:password])
@formatter = Gitlab::ImportFormatter.new @formatter = Gitlab::ImportFormatter.new
else else
raise Projects::ImportService::Error, "Unable to find project import data credentials for project ID: #{@project.id}" raise Projects::ImportService::Error, "Unable to find project import data credentials for project ID: #{@project.id}"