fix: contributor load cache data

This commit is contained in:
2021-11-02 11:27:17 +08:00
parent 282d3d0122
commit 43c683e83f
3 changed files with 18 additions and 22 deletions

View File

@@ -56,17 +56,7 @@ json.tags_count @result[:branch_tag_total_count]['tag_count'] || 0
json.contributors do
total_count = @result[:contributor].size
json.list @result[:contributor].each do |contributor|
user = User.find_by(gitea_uid: contributor["id"])
if contributor["login"] == "root" || user.nil?
total_count -= 1
next
end
json.contributions contributor["contributions"]
json.gid contributor["id"]
json.login user.login
json.type user&.type
json.name user.real_name
json.image_url url_to_avatar(user)
json.partial! 'contributor', locals: { contributor: contributor }
end
json.total_count total_count
end