Merge lp:~jtv/launchpad/bug-423191 into lp:launchpad

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~jtv/launchpad/bug-423191
Merge into: lp:launchpad
Diff against target: None lines
To merge this branch: bzr merge lp:~jtv/launchpad/bug-423191
Reviewer Review Type Date Requested Status
Данило Шеган (community) code Approve
Jeroen T. Vermeulen (community) Abstain
Review via email: mp+11124@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

= Bug 423191 =

When fetching random suggestions for the stuff-to-translate list, I
forgot to slice the results before feeding them into the links
aggregator. So the aggregator went through everything it could find
that you could possibly translate, which may have taken a bit longer
than necessary.

Jeroen

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Please ignore auto-generated diff. Here's what I have now:

=== modified file 'lib/lp/translations/browser/person.py'
--- lib/lp/translations/browser/person.py 2009-08-31 16:55:39 +0000
+++ lib/lp/translations/browser/person.py 2009-09-03 12:48:47 +0000
@@ -249,6 +249,9 @@
         pofiles = person.suggestTranslatableFiles(
             no_older_than=self.history_horizon)

+ if max_fetch is not None:
+ pofiles = pofiles[:max_fetch]
+
         return TranslateLinksAggregator().aggregate(pofiles)

     @cachedproperty

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Danilo's reviewing this one.

review: Abstain
Revision history for this message
Данило Шеган (danilo) wrote :

It'd be nice to have a test to make sure we don't miss it again, though. Basically, just create a bunch of translationmessages and make sure the list doesn't grow past that maximum.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/browser/person.py'
2--- lib/lp/translations/browser/person.py 2009-08-31 16:55:39 +0000
3+++ lib/lp/translations/browser/person.py 2009-09-03 12:39:13 +0000
4@@ -247,7 +247,7 @@
5 """Suggest translations this person could be helping complete."""
6 person = ITranslationsPerson(self.context)
7 pofiles = person.suggestTranslatableFiles(
8- no_older_than=self.history_horizon)
9+ no_older_than=self.history_horizon)[:max_fetch]
10
11 return TranslateLinksAggregator().aggregate(pofiles)
12