容错处理
This commit is contained in:
parent
d2ced0bc6c
commit
c90fc3d487
|
@ -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…
Reference in New Issue