diff options
author | Artem Sidorenko <artem.sidorenko@telekom.de> | 2015-08-14 16:56:33 +0300 |
---|---|---|
committer | Artem Sidorenko <artem.sidorenko@telekom.de> | 2015-08-20 13:13:22 +0300 |
commit | e238a8dad5ec6d1bb80cc8d4dd2b3f85b55a6879 (patch) | |
tree | 5571e55d54c0bc83594083a42acae76594c4321b /app/controllers/import | |
parent | 55dca86b983496a26a3913aead77439edf96afe9 (diff) |
Import sources: show only enabled sources
Diffstat (limited to 'app/controllers/import')
-rw-r--r-- | app/controllers/import/gitorious_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/import/google_code_controller.rb | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/import/gitorious_controller.rb b/app/controllers/import/gitorious_controller.rb index c121d2de7cb..f24cdb3709a 100644 --- a/app/controllers/import/gitorious_controller.rb +++ b/app/controllers/import/gitorious_controller.rb @@ -1,4 +1,5 @@ class Import::GitoriousController < Import::BaseController + before_action :verify_gitorious_import_enabled def new redirect_to client.authorize_url(callback_import_gitorious_url) @@ -40,4 +41,8 @@ class Import::GitoriousController < Import::BaseController @client ||= Gitlab::GitoriousImport::Client.new(session[:gitorious_repos]) end + def verify_gitorious_import_enabled + not_found! unless gitorious_import_enabled? + end + end diff --git a/app/controllers/import/google_code_controller.rb b/app/controllers/import/google_code_controller.rb index 4aa6d28c9a8..82fadeb7e83 100644 --- a/app/controllers/import/google_code_controller.rb +++ b/app/controllers/import/google_code_controller.rb @@ -1,4 +1,5 @@ class Import::GoogleCodeController < Import::BaseController + before_action :verify_google_code_import_enabled before_action :user_map, only: [:new_user_map, :create_user_map] def new @@ -104,6 +105,10 @@ class Import::GoogleCodeController < Import::BaseController @client ||= Gitlab::GoogleCodeImport::Client.new(session[:google_code_dump]) end + def verify_google_code_import_enabled + not_found! unless google_code_import_enabled? + end + def user_map @user_map ||= begin user_map = client.user_map |