Fix bug with articles without a pagerank
This commit is contained in:
parent
0b2d3d4cc3
commit
7ffc2ba1e1
|
@ -208,7 +208,9 @@ def build_statistics_page(articles, config):
|
||||||
for a in articles
|
for a in articles
|
||||||
if a.player == player]
|
if a.player == player]
|
||||||
for player in players}
|
for player in players}
|
||||||
player_rank = {player : sum(map(lambda a: ranks[a.title], articles)) for player, articles in articles_by.items()}
|
player_rank = {
|
||||||
|
player : sum(map(lambda a: ranks[a.title] if a.title in ranks else 0, articles))
|
||||||
|
for player, articles in articles_by.items()}
|
||||||
content += "<br>\n".join(map(
|
content += "<br>\n".join(map(
|
||||||
lambda kv: "{0} – {1}".format(kv[0], round(kv[1], 3)),
|
lambda kv: "{0} – {1}".format(kv[0], round(kv[1], 3)),
|
||||||
sorted(player_rank.items(), key=lambda t:t[1], reverse=True)))
|
sorted(player_rank.items(), key=lambda t:t[1], reverse=True)))
|
||||||
|
|
Loading…
Reference in New Issue