Top contributors list broken

Bug #564852 reported by Moritz Baumann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Adi Roiban

Bug Description

Example: https://translations.launchpad.net/+languages/de

The list shows those people with the lowest karma instead of those with the highest. Not really important, but might be easy to fix if it’s just the ordering …

Related branches

Moritz Baumann (mo42)
description: updated
Revision history for this message
Adi Roiban (adiroiban) wrote :

Thanks Moritz for reporting this problem.
I will look at what happened and will try to fix it... most probably is my fault.

Changed in rosetta:
status: New → In Progress
assignee: nobody → Adi Roiban (adiroiban)
Revision history for this message
Данило Шеган (danilo) wrote :

Adi, btw, you should probably use slicing to return up to 20 items from a SQL result object (it will be most efficient way). If some get removed because they are merged, it still is not too bad to return eg. 17 items, compared to serializing all 1300 Person objects for some languages (like Spanish or French).

To do it, simply do something like:

  top_translators = self.context.translators[:20]
  returned_translators = []
  for translator in top_translators:
    ...

Changed in rosetta:
importance: Undecided → High
Revision history for this message
Adi Roiban (adiroiban) wrote :

Ok. I will do it. I didn't use the slicing to avoid creating a top 20 that only contains 17 items.

If you say that returning 17 items is ok, then I will use slicing and maybe I can change the text from "Top 20 contributors" to "Top contributors".

I will change the code and will create a MP right away.

Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in rosetta:
milestone: none → 10.04
status: In Progress → Fix Committed
tags: added: qa-needstesting
Adi Roiban (adiroiban)
tags: added: qa-ok
removed: qa-needstesting
Changed in rosetta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.