From: antzucaro Date: Sat, 28 Apr 2012 12:30:30 +0000 (-0400) Subject: Don't throw an error if the number of duel ranks found is < 10. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf29039b4b6632de8ded060c8982d92270fb6f9b;p=xonotic%2Fxonstat.git Don't throw an error if the number of duel ranks found is < 10. I was using '-' as a filler in such cases, and was populating four values into a tuple. The template expected three, so in situations when I had to fall back on the filler values, I was providing one too many, leading to 'too many values to unpack' upon loading up the main page. --- diff --git a/xonstat/views/main.py b/xonstat/views/main.py index ae67aa1..51624d5 100755 --- a/xonstat/views/main.py +++ b/xonstat/views/main.py @@ -29,7 +29,7 @@ def main_index(request): for (player_id, nick, elo) in duel_ranks] for i in range(leaderboard_count-len(duel_ranks)): - duel_ranks.append(('-', '-', '-', '-')) + duel_ranks.append(('-', '-', '-')) # top ranked CTF-ers ctf_ranks = DBSession.query(PlayerRank.player_id, PlayerRank.nick,