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

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Michael Hudson-Doyle
Approved revision: no longer in the source branch.
Merged at revision: 11511
Proposed branch: lp:~jtv/launchpad/bug-631259
Merge into: lp:launchpad
Diff against target: 50 lines (+20/-0)
2 files modified
lib/lp/translations/model/potmsgset.py (+2/-0)
lib/lp/translations/tests/test_translationmessage.py (+18/-0)
To merge this branch: bzr merge lp:~jtv/launchpad/bug-631259
Reviewer Review Type Date Requested Status
Tim Penhey (community) release-critical Approve
Michael Hudson-Doyle Approve
Launchpad code reviewers code Pending
Review via email: mp+34651@code.launchpad.net

Commit message

Keep initializing TM.pofile on edge while production needs it.

Description of the change

= Bug 631259 =

Release-critical.

The work on bug 597539 finally removes our dependency on TranslationMessage.pofile, and stops initializing that field. But until rollout, the production code still relies on it while edge merrily produces records that have it nulled!

This fix simply restores the original initializer. (A diff against devel from 2010-09-03 shows my comment as the only difference in the file). I'll prepare a separate branch that removes it again after rollout.

Jeroen

To post a comment you must log in.
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Approved. I assume you're very confident this works as there's no test :-)

review: Approve
Revision history for this message
Tim Penhey (thumper) :
review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/model/potmsgset.py'
2--- lib/lp/translations/model/potmsgset.py 2010-09-03 14:53:09 +0000
3+++ lib/lp/translations/model/potmsgset.py 2010-09-06 04:32:46 +0000
4@@ -843,9 +843,11 @@
5 imported_message.is_current = False
6 return None
7 else:
8+ # The pofile=pofile is only needed until 10.09 rollout.
9 matching_message = TranslationMessage(
10 potmsgset=self,
11 potemplate=pofile.potemplate,
12+ pofile=pofile,
13 language=pofile.language,
14 origin=origin,
15 submitter=submitter,
16
17=== modified file 'lib/lp/translations/tests/test_translationmessage.py'
18--- lib/lp/translations/tests/test_translationmessage.py 2010-08-20 20:31:18 +0000
19+++ lib/lp/translations/tests/test_translationmessage.py 2010-09-06 04:32:46 +0000
20@@ -5,6 +5,7 @@
21
22 __metaclass__ = type
23
24+
25 from zope.component import getUtility
26 from zope.security.proxy import removeSecurityProxy
27
28@@ -15,6 +16,23 @@
29 from lp.translations.model.potranslation import POTranslation
30
31
32+class TestPOFileStillInitialized(TestCaseWithFactory):
33+ """Until the 10.09 rollout, TranslationMessage.pofile is still needed.
34+
35+ This is a fix for just a few days. We still need to initialize this
36+ on edge while production still relies on it.
37+
38+ Remove this test, as well as the initialization of pofile in
39+ POTMsgSet.updateTranslation, after 10.09 rollout.
40+ """
41+ layer = ZopelessDatabaseLayer
42+
43+ def test_pofile_still_initialized(self):
44+ pofile = self.factory.makePOFile('sux')
45+ tm = self.factory.makeTranslationMessage(pofile=pofile)
46+ self.assertEqual(pofile, tm.pofile)
47+
48+
49 class TestTranslationMessageFindIdenticalMessage(TestCaseWithFactory):
50 """Tests for `TranslationMessage.findIdenticalMessage`."""
51