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
=== modified file 'lib/lp/translations/model/potmsgset.py'
--- lib/lp/translations/model/potmsgset.py 2010-09-03 14:53:09 +0000
+++ lib/lp/translations/model/potmsgset.py 2010-09-06 04:32:46 +0000
@@ -843,9 +843,11 @@
843 imported_message.is_current = False843 imported_message.is_current = False
844 return None844 return None
845 else:845 else:
846 # The pofile=pofile is only needed until 10.09 rollout.
846 matching_message = TranslationMessage(847 matching_message = TranslationMessage(
847 potmsgset=self,848 potmsgset=self,
848 potemplate=pofile.potemplate,849 potemplate=pofile.potemplate,
850 pofile=pofile,
849 language=pofile.language,851 language=pofile.language,
850 origin=origin,852 origin=origin,
851 submitter=submitter,853 submitter=submitter,
852854
=== modified file 'lib/lp/translations/tests/test_translationmessage.py'
--- lib/lp/translations/tests/test_translationmessage.py 2010-08-20 20:31:18 +0000
+++ lib/lp/translations/tests/test_translationmessage.py 2010-09-06 04:32:46 +0000
@@ -5,6 +5,7 @@
55
6__metaclass__ = type6__metaclass__ = type
77
8
8from zope.component import getUtility9from zope.component import getUtility
9from zope.security.proxy import removeSecurityProxy10from zope.security.proxy import removeSecurityProxy
1011
@@ -15,6 +16,23 @@
15from lp.translations.model.potranslation import POTranslation16from lp.translations.model.potranslation import POTranslation
1617
1718
19class TestPOFileStillInitialized(TestCaseWithFactory):
20 """Until the 10.09 rollout, TranslationMessage.pofile is still needed.
21
22 This is a fix for just a few days. We still need to initialize this
23 on edge while production still relies on it.
24
25 Remove this test, as well as the initialization of pofile in
26 POTMsgSet.updateTranslation, after 10.09 rollout.
27 """
28 layer = ZopelessDatabaseLayer
29
30 def test_pofile_still_initialized(self):
31 pofile = self.factory.makePOFile('sux')
32 tm = self.factory.makeTranslationMessage(pofile=pofile)
33 self.assertEqual(pofile, tm.pofile)
34
35
18class TestTranslationMessageFindIdenticalMessage(TestCaseWithFactory):36class TestTranslationMessageFindIdenticalMessage(TestCaseWithFactory):
19 """Tests for `TranslationMessage.findIdenticalMessage`."""37 """Tests for `TranslationMessage.findIdenticalMessage`."""
2038