Commit 400b3d26 authored by Stan Hu's avatar Stan Hu

Merge pull request #9632 from szechyjs/update-fogbugz-gem

Use fixed version of fogbugz gem
parents bc10a48c 93bb8f14
...@@ -158,7 +158,7 @@ gem "slack-notifier", "~> 1.0.0" ...@@ -158,7 +158,7 @@ gem "slack-notifier", "~> 1.0.0"
gem 'asana', '~> 0.0.6' gem 'asana', '~> 0.0.6'
# FogBugz integration # FogBugz integration
gem 'ruby-fogbugz' gem 'ruby-fogbugz', '~> 0.2.0'
# d3 # d3
gem 'd3_rails', '~> 3.5.5' gem 'd3_rails', '~> 3.5.5'
......
...@@ -575,8 +575,8 @@ GEM ...@@ -575,8 +575,8 @@ GEM
powerpack (~> 0.0.6) powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4) ruby-progressbar (~> 1.4)
ruby-fogbugz (0.1.1) ruby-fogbugz (0.2.0)
crack crack (~> 0.4)
ruby-progressbar (1.7.1) ruby-progressbar (1.7.1)
ruby-saml (1.0.0) ruby-saml (1.0.0)
nokogiri (>= 1.5.10) nokogiri (>= 1.5.10)
...@@ -849,7 +849,7 @@ DEPENDENCIES ...@@ -849,7 +849,7 @@ DEPENDENCIES
rqrcode-rails3 rqrcode-rails3
rspec-rails (~> 3.3.0) rspec-rails (~> 3.3.0)
rubocop (= 0.28.0) rubocop (= 0.28.0)
ruby-fogbugz ruby-fogbugz (~> 0.2.0)
sanitize (~> 2.0) sanitize (~> 2.0)
sass-rails (~> 4.0.5) sass-rails (~> 4.0.5)
sdoc sdoc
......
...@@ -2,7 +2,6 @@ class Import::FogbugzController < Import::BaseController ...@@ -2,7 +2,6 @@ class Import::FogbugzController < Import::BaseController
before_action :verify_fogbugz_import_enabled before_action :verify_fogbugz_import_enabled
before_action :user_map, only: [:new_user_map, :create_user_map] before_action :user_map, only: [:new_user_map, :create_user_map]
# Doesn't work yet due to bug in ruby-fogbugz, see below
rescue_from Fogbugz::AuthenticationException, with: :fogbugz_unauthorized rescue_from Fogbugz::AuthenticationException, with: :fogbugz_unauthorized
def new def new
...@@ -13,8 +12,8 @@ class Import::FogbugzController < Import::BaseController ...@@ -13,8 +12,8 @@ class Import::FogbugzController < Import::BaseController
begin begin
res = Gitlab::FogbugzImport::Client.new(import_params.symbolize_keys) res = Gitlab::FogbugzImport::Client.new(import_params.symbolize_keys)
rescue rescue
# Needed until https://github.com/firmafon/ruby-fogbugz/pull/9 is merged # If the URI is invalid various errors can occur
return redirect_to :back, alert: 'Could not authenticate with FogBugz, check your URL, email, and password' return redirect_to new_import_fogbugz_path, alert: 'Could not connect to FogBugz, check your URL'
end end
session[:fogbugz_token] = res.get_token session[:fogbugz_token] = res.get_token
session[:fogbugz_uri] = params[:uri] session[:fogbugz_uri] = params[:uri]
...@@ -92,8 +91,7 @@ class Import::FogbugzController < Import::BaseController ...@@ -92,8 +91,7 @@ class Import::FogbugzController < Import::BaseController
end end
def fogbugz_unauthorized(exception) def fogbugz_unauthorized(exception)
flash[:alert] = exception.message redirect_to new_import_fogbugz_path, alert: exception.message
redirect_to new_import_fogbugz_path
end end
def import_params def import_params
......
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