Skip to content
Browse files

Sort duplicates by number of comments

  • Loading branch information...
1 parent 7cf4926 commit 59c22e8bf36edbf92aa078201666c9a800bc2385 @kemitche kemitche committed Jul 30, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 r2/r2/controllers/front.py
View
2 r2/r2/controllers/front.py
@@ -51,6 +51,7 @@
from pylons import c, request, request, Response
from r2.models.token import EmailVerificationToken
+from operator import attrgetter
import string
import random as rand
import re, socket
@@ -704,6 +705,7 @@ def GET_duplicates(self, article, num, after, reverse, count):
abort(403, 'forbidden')
links = link_duplicates(article)
+ links.sort(key=attrgetter('num_comments'), reverse=True)
builder = IDBuilder([ link._fullname for link in links ],
num = num, after = after, reverse = reverse,
count = count, skip = False)

0 comments on commit 59c22e8

Please sign in to comment.
Something went wrong with that request. Please try again.