Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-04-05 16:41:15 +0300
committerJames Lopez <james@jameslopez.es>2016-04-05 16:41:15 +0300
commit5e51fce4dcd62997f372aed44badc844f98851e9 (patch)
tree5599e0de61315e6274449c11c1fa011c91f8d749 /lib/gitlab/bitbucket_import
parent850180aa393e2cfc124bb9687a123a196cff734c (diff)
some refactoring to symbolise keys across importers and left a TODO
Diffstat (limited to 'lib/gitlab/bitbucket_import')
-rw-r--r--lib/gitlab/bitbucket_import/client.rb8
-rw-r--r--lib/gitlab/bitbucket_import/project_creator.rb2
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/gitlab/bitbucket_import/client.rb b/lib/gitlab/bitbucket_import/client.rb
index acd0f298b3d..49f86ab5edf 100644
--- a/lib/gitlab/bitbucket_import/client.rb
+++ b/lib/gitlab/bitbucket_import/client.rb
@@ -6,10 +6,10 @@ module Gitlab
attr_reader :consumer, :api
def self.from_project(project)
- credentials = project.import_data.stringified_credentials if project.import_data
- if defined?(credentials) && credentials['bb_session']
- token = credentials['bb_session']['bitbucket_access_token']
- token_secret = credentials['bb_session']['bitbucket_access_token_secret']
+ credentials = project.import_data if project.import_data
+ if credentials && credentials[:bb_session]
+ token = credentials[:bb_session][:bitbucket_access_token]
+ token_secret = credentials[:bb_session][:bitbucket_access_token_secret]
new(token, token_secret)
else
raise Projects::ImportService::Error, "Unable to find project import data credentials for project ID: #{@project.id}"
diff --git a/lib/gitlab/bitbucket_import/project_creator.rb b/lib/gitlab/bitbucket_import/project_creator.rb
index cc7f2017142..109010cb962 100644
--- a/lib/gitlab/bitbucket_import/project_creator.rb
+++ b/lib/gitlab/bitbucket_import/project_creator.rb
@@ -25,7 +25,7 @@ module Gitlab
import_data = project.import_data
# merge! with a bang doesn't work here
- import_data.credentials = import_data.credentials.merge("bb_session" => session_data)
+ import_data.credentials = import_data.credentials.merge(bb_session: session_data)
import_data.save
project