← Back to team overview

launchpad-reviewers team mailing list archive

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

 

William Grant has proposed merging lp:~wgrant/launchpad/constant-contributors into lp:launchpad.

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

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/constant-contributors/+merge/250394

Fix ValidPersonCache query for each POFileTranslator on POFile:+translate.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/constant-contributors into lp:launchpad.
=== modified file 'lib/lp/translations/browser/pofile.py'
--- lib/lp/translations/browser/pofile.py	2014-02-26 03:05:44 +0000
+++ lib/lp/translations/browser/pofile.py	2015-02-19 23:28:06 +0000
@@ -265,7 +265,9 @@
 
     @cachedproperty
     def contributors(self):
-        return list(self.context.contributors)
+        return list(getUtility(IPersonSet).getPrecachedPersonsFromIDs(
+            [person.id for person in self.context.contributors],
+            need_validity=True))
 
     @cachedproperty
     def user_can_edit(self):

=== modified file 'lib/lp/translations/browser/tests/test_pofile_view.py'
--- lib/lp/translations/browser/tests/test_pofile_view.py	2014-07-01 14:30:08 +0000
+++ lib/lp/translations/browser/tests/test_pofile_view.py	2015-02-19 23:28:06 +0000
@@ -77,11 +77,6 @@
             templateset.wipeSuggestivePOTemplatesCache()
             templateset.populateSuggestivePOTemplatesCache()
 
-            # And ensure that the credits string is empty, as that's
-            # not currently constant.
-            Store.of(pofile).find(POFileTranslator, pofile=pofile).set(
-                pofileID=self.factory.makePOFile().id)
-
         nb_objects = 2
         recorder1, recorder2 = record_two_runs(
             lambda: create_initialized_view(


Follow ups