Skip to content

Commit

Permalink
limit the JSON leaderboard endpoint to 25 users, like the main endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
relrod committed Aug 10, 2013
1 parent b951bf3 commit 752b4d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tahrir/views.py
Expand Up @@ -350,7 +350,7 @@ def leaderboard_json(request):

# Get top persons.
persons_assertions = request.db.get_all_assertions().join(m.Person).filter(
m.Person.opt_out == False)
m.Person.opt_out == False)[:25]
from collections import defaultdict
top_persons = defaultdict(int) # person: assertion count
for item in persons_assertions:
Expand Down

0 comments on commit 752b4d7

Please sign in to comment.