Merge lp:~wgrant/launchpad/constant-contributors into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17352
Proposed branch: lp:~wgrant/launchpad/constant-contributors
Merge into: lp:launchpad
Diff against target: 30 lines (+3/-6)
2 files modified
lib/lp/translations/browser/pofile.py (+3/-1)
lib/lp/translations/browser/tests/test_pofile_view.py (+0/-5)
To merge this branch: bzr merge lp:~wgrant/launchpad/constant-contributors
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+250394@code.launchpad.net

Commit message

Fix ValidPersonCache query for each POFileTranslator on POFile:+translate.

Description of the change

Fix ValidPersonCache query for each POFileTranslator on POFile:+translate.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
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/pofile.py'
2--- lib/lp/translations/browser/pofile.py 2014-02-26 03:05:44 +0000
3+++ lib/lp/translations/browser/pofile.py 2015-02-19 23:28:06 +0000
4@@ -265,7 +265,9 @@
5
6 @cachedproperty
7 def contributors(self):
8- return list(self.context.contributors)
9+ return list(getUtility(IPersonSet).getPrecachedPersonsFromIDs(
10+ [person.id for person in self.context.contributors],
11+ need_validity=True))
12
13 @cachedproperty
14 def user_can_edit(self):
15
16=== modified file 'lib/lp/translations/browser/tests/test_pofile_view.py'
17--- lib/lp/translations/browser/tests/test_pofile_view.py 2014-07-01 14:30:08 +0000
18+++ lib/lp/translations/browser/tests/test_pofile_view.py 2015-02-19 23:28:06 +0000
19@@ -77,11 +77,6 @@
20 templateset.wipeSuggestivePOTemplatesCache()
21 templateset.populateSuggestivePOTemplatesCache()
22
23- # And ensure that the credits string is empty, as that's
24- # not currently constant.
25- Store.of(pofile).find(POFileTranslator, pofile=pofile).set(
26- pofileID=self.factory.makePOFile().id)
27-
28 nb_objects = 2
29 recorder1, recorder2 = record_two_runs(
30 lambda: create_initialized_view(