diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-11 13:38:37 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-11 13:38:37 +0200 |
commit | 2ed2ef921026cbde5dddda89177bfa50e2993ecd (patch) | |
tree | a320046ab80fb624d585a6d903a0a1d61dbd4dd3 /app/controllers | |
parent | 187face620cfa0d5617a1c49e28dfbb20134fe41 (diff) | |
download | gitlab-ce-2ed2ef921026cbde5dddda89177bfa50e2993ecd.tar.gz |
Remove network from CI
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/ci/application_controller.rb | 27 | ||||
-rw-r--r-- | app/controllers/ci/projects_controller.rb | 6 |
2 files changed, 2 insertions, 31 deletions
diff --git a/app/controllers/ci/application_controller.rb b/app/controllers/ci/application_controller.rb index 9a32efaee7d..a5868da377f 100644 --- a/app/controllers/ci/application_controller.rb +++ b/app/controllers/ci/application_controller.rb @@ -4,14 +4,8 @@ module Ci "app/helpers/ci" end - include Ci::UserSessionsHelper - - rescue_from Ci::Network::UnauthorizedError, with: :invalid_token - before_filter :default_headers helper_method :gl_project - protect_from_forgery - private def authenticate_public_page! @@ -75,27 +69,6 @@ module Ci } end - def check_config - redirect_to oauth2_ci_help_path unless valid_config? - end - - def valid_config? - server = GitlabCi.config.gitlab_server - - if server.blank? || server.url.blank? || server.app_id.blank? || server.app_secret.blank? - false - else - true - end - rescue Settingslogic::MissingSetting, NoMethodError - false - end - - def invalid_token - reset_session - redirect_to ci_root_path - end - def gl_project ::Project.find(@project.gitlab_id) end diff --git a/app/controllers/ci/projects_controller.rb b/app/controllers/ci/projects_controller.rb index c30c5d9590b..9074972e94a 100644 --- a/app/controllers/ci/projects_controller.rb +++ b/app/controllers/ci/projects_controller.rb @@ -27,7 +27,7 @@ module Ci @projects = Ci::Project.where(gitlab_id: @gl_projects.map(&:id)).ordered_by_last_commit_date @total_count = @gl_projects.size - + @gl_projects = @gl_projects.where.not(id: @projects.map(&:gitlab_id)) respond_to do |format| @@ -35,8 +35,6 @@ module Ci pager_json("ci/projects/gitlab", @total_count) end end - rescue Ci::Network::UnauthorizedError - raise rescue @error = 'Failed to fetch GitLab projects' end @@ -82,8 +80,8 @@ module Ci end def destroy + project.gl_project.gitlab_ci_service.update_attributes(active: false) project.destroy - Ci::Network.new.disable_ci(project.gitlab_id, current_user.authenticate_options) Ci::EventService.new.remove_project(current_user, project) |