summaryrefslogtreecommitdiff
path: root/app/controllers/import/github_controller.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-17 22:52:32 +0100
committerDouwe Maan <douwe@gitlab.com>2015-02-24 15:07:24 +0100
commit448817c4de965bf7286f33a3447937987a8864a1 (patch)
tree4429ddccab6ff9437950f449272dfdad7362d0b1 /app/controllers/import/github_controller.rb
parentad6d6232342558705c54ba70a94f9d7ddbd00f8c (diff)
downloadgitlab-ce-448817c4de965bf7286f33a3447937987a8864a1.tar.gz
Load public key in initializer.
Diffstat (limited to 'app/controllers/import/github_controller.rb')
-rw-r--r--app/controllers/import/github_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/import/github_controller.rb b/app/controllers/import/github_controller.rb
index c869c7c86f3..dc7668ee6fd 100644
--- a/app/controllers/import/github_controller.rb
+++ b/app/controllers/import/github_controller.rb
@@ -1,4 +1,5 @@
class Import::GithubController < Import::BaseController
+ before_filter :verify_github_import_enabled
before_filter :github_auth, except: :callback
rescue_from Octokit::Unauthorized, with: :github_unauthorized
@@ -44,6 +45,10 @@ class Import::GithubController < Import::BaseController
@client ||= Gitlab::GithubImport::Client.new(current_user.github_access_token)
end
+ def verify_github_import_enabled
+ not_found! unless github_import_enabled?
+ end
+
def github_auth
if current_user.github_access_token.blank?
go_to_github_for_permissions