|
|
|
@@ -1,19 +1,19 @@ |
|
|
|
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? |
|
|
|
json.contributions contributor["commits"] |
|
|
|
json.contributions contributor["commits"] || contributor["contributions"] |
|
|
|
json.login nil |
|
|
|
json.type nil |
|
|
|
json.name contributor["name"].downcase |
|
|
|
json.name (contributor["name"] || contributor["login"]).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"]) |
|
|
|
json.image_url User::Avatar.get_letter_avatar_url(contributor["name"] || contributor["login"]) |
|
|
|
json.contribution_perc User.new(login: (contributor["name"] || contributor["login"]), mail: contributor["email"]).simple_contribution_perc(project, contributor["contribution_perc"]) |
|
|
|
else |
|
|
|
json.contributions contributor["commits"] |
|
|
|
json.contributions contributor["commits"] || contributor["contributions"] |
|
|
|
json.id user["id"] |
|
|
|
json.login user["login"] |
|
|
|
json.email user["email"] |
|
|
|
json.type user["type"] |
|
|
|
json.name user["name"].downcase |
|
|
|
json.name (user["name"] || contributor["name"] || contributor["login"]).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? |
|
|
|
|