Browse Source

容错处理

pull/342/head
xxq250 3 years ago
parent
commit
c90fc3d487
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      app/views/repositories/_contributor.json.jbuilder

+ 2
- 2
app/views/repositories/_contributor.json.jbuilder View File

@@ -3,7 +3,7 @@ if user.blank?
json.contributions contributor["commits"]
json.login nil
json.type nil
json.name contributor["name"].downcase
json.name contributor["name"].to_s.downcase
json.email contributor["email"]
json.image_url User::Avatar.get_letter_avatar_url(contributor["name"])
json.contribution_perc User.new(login: contributor["name"], mail: contributor["email"]).simple_contribution_perc(project, contributor["contribution_perc"])
@@ -13,7 +13,7 @@ else
json.login user["login"]
json.email user["email"]
json.type user["type"]
json.name user["name"].downcase
json.name user["name"].to_s.downcase
json.image_url user["avatar_url"]
db_user = User.find_by_id(user["id"])
json.contribution_perc db_user.simple_contribution_perc(project, contributor["contribution_perc"]) if db_user.present?


Loading…
Cancel
Save