Commit c136edbb authored by James Lopez's avatar James Lopez

fix gitlab import and spec

parent 8aafe685
......@@ -5,10 +5,13 @@ module Gitlab
def initialize(project)
@project = project
import_data = project.import_data.try(:data)
gitlab_session = import_data["gitlab_session"] if import_data
@client = Client.new(gitlab_session["gitlab_access_token"])
@formatter = Gitlab::ImportFormatter.new
credentials = import_data.credentials
if credentials && credentials["password"]
@client = Client.new(credentials["password"])
@formatter = Gitlab::ImportFormatter.new
else
raise Projects::ImportService::Error, "Unable to find project import data credentials for project ID: #{@project.id}"
end
end
def execute
......
......@@ -23,7 +23,6 @@ module Gitlab
import_url: repo["http_url_to_repo"].sub("://", "://oauth2:#{@session_data[:gitlab_access_token]}@")
).execute
project.create_import_data(data: { "gitlab_session" => session_data } )
project
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment