diff --git a/.gitignore b/.gitignore index 2bc78b8dd..446301cf1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ config/deploy.rb .swn .ruby-gemset .ruby-version -.localeapp \ No newline at end of file +.localeapp +config/initializers/github.rb diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index 33893c779..e8dff652c 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -14,7 +14,6 @@ class Projects::BuildListsController < Projects::BaseController def index authorize :build_list params[:filter].each{|k,v| params[:filter].delete(k) if v.blank? } if params[:filter] - @project.fetch_github_repo_data unless not @project respond_to do |format| format.html @@ -43,7 +42,6 @@ class Projects::BuildListsController < Projects::BaseController def new authorize @build_list = @project.build_lists.build - @project.fetch_github_repo_data unless not @project if params[:show] == 'inline' && params[:build_list_id].present? render json: new_build_list_data(@build_list, @project, params), layout: false else diff --git a/app/models/project.rb b/app/models/project.rb index 9749904fb..0a85611cc 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -60,20 +60,19 @@ class Project < ActiveRecord::Base before_create :set_maintainer after_save :attach_to_personal_repository after_update -> { update_path_to_project(name_was) }, if: :name_changed? - after_find :fetch_github_repo_data - attr_accessor :url, :srpms_list, :mass_import, :add_to_repository_id, :github_data + attr_accessor :url, :srpms_list, :mass_import, :add_to_repository_id def init_mass_import Project.perform_later :low, :run_mass_import, url, srpms_list, visibility, owner, add_to_repository_id end - def fetch_github_repo_data + def github_data org = github_organization || APP_CONFIG["github_organization"] begin - @github_data = Github.repos.get user: org, repo: name + Github.repos.get user: org, repo: name rescue - @github_data = nil + nil end end