]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Don't throw an error if the number of duel ranks found is < 10.
authorantzucaro <azucaro@gmail.com>
Sat, 28 Apr 2012 12:30:30 +0000 (08:30 -0400)
committerantzucaro <azucaro@gmail.com>
Sat, 28 Apr 2012 12:30:30 +0000 (08:30 -0400)
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.

xonstat/views/main.py

index ae67aa1d833e377c1e6f5e02f91c0e803befc74e..51624d503d07d6c8c87df1b3b22b23e632fdc61c 100755 (executable)
@@ -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,