diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index d7fdb51ac..1d98b17f4 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -169,18 +169,12 @@ class RepositoriesController < ApplicationController end def contributors - @cache_result = $redis_cache.get("ProjectSpecialCommit:#{@project.id}") - if @cache_result.present? - @total_count = Project.mindspore_contributors.size - @contributors = kaminari_array_paginate(Project.mindspore_contributors) - else - if params[:filepath].present? || @project.educoder? - @contributors = [] - else - result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier, {page: params[:page], limit: params[:limit]}) - @total_count = result[:total_count] - @contributors = result.is_a?(Hash) ? result[:body] : [] - end + if params[:filepath].present? || @project.educoder? + @contributors = [] + else + result = Gitea::Repository::Contributors::GetService.call(@owner, @repository.identifier, {page: params[:page], limit: params[:limit]}) + @total_count = result[:total_count] + @contributors = result.is_a?(Hash) ? result[:body] : [] end rescue @contributors = [] diff --git a/app/views/repositories/_contributor.json.jbuilder b/app/views/repositories/_contributor.json.jbuilder index d1bc16024..e93bdf370 100644 --- a/app/views/repositories/_contributor.json.jbuilder +++ b/app/views/repositories/_contributor.json.jbuilder @@ -2,9 +2,9 @@ user = $redis_cache.hgetall("v2-owner-common:#{contributor["login"]}-#{contribut if user.blank? json.contributions contributor["contributions"] # json.gid contributor["id"] - json.login contributor["login"] + json.login contributor["login"].downcase json.type nil - json.name contributor["login"] + json.name contributor["login"].downcase json.image_url User::Avatar.get_letter_avatar_url(contributor["login"]) json.contribution_perc User.new(login: contributor["login"], mail: contributor["email"]).simple_contribution_perc(project) else