From: hernani Date: Fri, 4 Jun 2010 01:21:22 +0000 (+0000) Subject: Fixes an error that may pop once in a while in some edge cases. X-Git-Tag: live~762 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/bcfa6603daa03e1b997b7269e11cc4e9f3851bef?ds=sidebyside Fixes an error that may pop once in a while in some edge cases. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@370 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/templatetags/node_tags.py b/forum/templatetags/node_tags.py index 82f6b71..c45272e 100644 --- a/forum/templatetags/node_tags.py +++ b/forum/templatetags/node_tags.py @@ -118,7 +118,7 @@ def comments(post, user): if len(all_comments) <= 5: top_scorers = all_comments else: - top_scorers = sorted(all_comments, lambda c1, c2: c2.score - c1.score)[0:5] + top_scorers = sorted(all_comments, lambda c1, c2: cmp(c2.score, c1.score))[0:5] comments = [] showing = 0