mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-22 20:55:46 +08:00
容错处理
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
user = $redis_cache.hgetall("v2-owner-common:#{contributor["name"]}-#{contributor["email"]}")
|
user = $redis_cache.hgetall("v2-owner-common:#{contributor["name"] || contributor["login"]}-#{contributor["email"]}")
|
||||||
if user.blank?
|
if user.blank?
|
||||||
json.contributions contributor["commits"]
|
json.contributions contributor["commits"]
|
||||||
json.login nil
|
json.login contributor["name"].to_s.downcase || contributor["login"].to_s.downcase
|
||||||
json.type nil
|
json.type nil
|
||||||
json.name contributor["name"].to_s.downcase
|
json.name contributor["name"].to_s.downcase || contributor["login"].to_s.downcase
|
||||||
json.email contributor["email"]
|
json.email contributor["email"]
|
||||||
json.image_url User::Avatar.get_letter_avatar_url(contributor["name"])
|
json.image_url User::Avatar.get_letter_avatar_url(contributor["name"] || contributor["login"])
|
||||||
json.contribution_perc User.new(login: contributor["name"], mail: contributor["email"]).simple_contribution_perc(project, contributor["contribution_perc"])
|
json.contribution_perc User.new(login: contributor["name"], mail: contributor["email"]).simple_contribution_perc(project, contributor["contribution_perc"])
|
||||||
else
|
else
|
||||||
json.contributions contributor["commits"]
|
json.contributions contributor["commits"]
|
||||||
|
|||||||
Reference in New Issue
Block a user