Merge lp:~danilo/launchpad/bug-474874 into lp:launchpad

Proposed by Данило Шеган
Status: Merged
Approved by: Muharem Hrnjadovic
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~danilo/launchpad/bug-474874
Merge into: lp:launchpad
Diff against target: 70 lines
3 files modified
database/schema/security.cfg (+4/-1)
lib/lp/translations/doc/fix_translation_credits.txt (+17/-0)
scripts/rosetta/fix_translation_credits.py (+2/-2)
To merge this branch: bzr merge lp:~danilo/launchpad/bug-474874
Reviewer Review Type Date Requested Status
Francis J. Lacoste (community) release-critical Approve
Muharem Hrnjadovic (community) Approve
Review via email: mp+14450@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

= Bug 474874 =

Add missing privileges to rosettaadmin DB user run the one-time script fix_translation_credits. Also provide a minimal test to make sure it works with the new permissions.

= Test =

bin/test -vvt fix_translation_credits

= Demo & QA =

Try re-running it on staging as `scripts/rosetta/fix_translation_credits.py -vvv` after security.cfg changes have been applied.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  database/schema/security.cfg
  lib/lp/translations/doc/fix_translation_credits.txt
  scripts/rosetta/fix_translation_credits.py

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Looks good!

review: Approve
Revision history for this message
Francis J. Lacoste (flacoste) :
review: Approve (release-critical)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'database/schema/security.cfg'
--- database/schema/security.cfg 2009-10-31 01:41:29 +0000
+++ database/schema/security.cfg 2009-11-05 00:25:25 +0000
@@ -1339,6 +1339,8 @@
1339public.distribution = SELECT1339public.distribution = SELECT
1340public.distroseries = SELECT1340public.distroseries = SELECT
1341public.distroserieslanguage = SELECT, INSERT, UPDATE1341public.distroserieslanguage = SELECT, INSERT, UPDATE
1342public.karma = SELECT, INSERT
1343public.karmaaction = SELECT
1342public.language = SELECT1344public.language = SELECT
1343public.packaging = SELECT1345public.packaging = SELECT
1344public.person = SELECT1346public.person = SELECT
@@ -1347,7 +1349,7 @@
1347public.pomsgid = SELECT1349public.pomsgid = SELECT
1348public.potemplate = SELECT, INSERT, DELETE1350public.potemplate = SELECT, INSERT, DELETE
1349public.potmsgset = SELECT, INSERT, DELETE1351public.potmsgset = SELECT, INSERT, DELETE
1350public.potranslation = SELECT1352public.potranslation = SELECT, INSERT
1351public.product = SELECT1353public.product = SELECT
1352public.productseries = SELECT1354public.productseries = SELECT
1353public.sourcepackagename = SELECT1355public.sourcepackagename = SELECT
@@ -1356,6 +1358,7 @@
1356public.translationmessage = SELECT, INSERT, UPDATE, DELETE1358public.translationmessage = SELECT, INSERT, UPDATE, DELETE
1357public.translationrelicensingagreement = SELECT1359public.translationrelicensingagreement = SELECT
1358public.translationtemplateitem = SELECT, INSERT, UPDATE, DELETE1360public.translationtemplateitem = SELECT, INSERT, UPDATE, DELETE
1361public.validpersoncache = SELECT
13591362
1360[translationsbranchscanner]1363[translationsbranchscanner]
1361type=user1364type=user
13621365
=== added file 'lib/lp/translations/doc/fix_translation_credits.txt'
--- lib/lp/translations/doc/fix_translation_credits.txt 1970-01-01 00:00:00 +0000
+++ lib/lp/translations/doc/fix_translation_credits.txt 2009-11-05 00:25:25 +0000
@@ -0,0 +1,17 @@
1Script `fix_translation_credits.py`
2====================================
3
4Marks all existing translation credits as translated.
5
6 >>> from canonical.launchpad.ftests.script import run_script
7 >>> (returncode, out, err) = run_script(
8 ... 'scripts/rosetta/fix_translation_credits.py')
9 >>> print returncode
10 0
11 >>> print err
12 INFO creating lockfile
13 INFO Figuring out POFiles that need fixing: this may take a while...
14 INFO Marking up a total of 3 credits as translated.
15 INFO Processed ...
16 INFO Done.
17
018
=== modified file 'scripts/rosetta/fix_translation_credits.py'
--- scripts/rosetta/fix_translation_credits.py 2009-10-29 12:36:32 +0000
+++ scripts/rosetta/fix_translation_credits.py 2009-11-05 00:25:25 +0000
@@ -9,12 +9,12 @@
99
10import _pythonpath10import _pythonpath
1111
12from lp.services.scripts.base import LaunchpadCronScript12from lp.services.scripts.base import LaunchpadScript
13from lp.translations.scripts.fix_translation_credits import (13from lp.translations.scripts.fix_translation_credits import (
14 FixTranslationCreditsProcess)14 FixTranslationCreditsProcess)
1515
1616
17class FixTranslationCredits(LaunchpadCronScript):17class FixTranslationCredits(LaunchpadScript):
18 """Go through all POFiles and mark translation credits as translated."""18 """Go through all POFiles and mark translation credits as translated."""
1919
20 def main(self):20 def main(self):