Code review comment for lp:~adiroiban/launchpad/bug-406477

Revision history for this message
Adi Roiban (adiroiban) wrote :

Many thanks for the review... there we a couple of stupid errors :(
For the future I will try to read the whole diff at least twice.

Latest diff.

=== modified file 'lib/canonical/launchpad/icing/style-3-0.css'
--- lib/canonical/launchpad/icing/style-3-0.css 2009-12-10 12:46:11 +0000
+++ lib/canonical/launchpad/icing/style-3-0.css 2009-12-11 11:33:39 +0000
@@ -682,7 +682,8 @@
  */

 .inactive-template td {
- background-color: #DCDCDC;
+ background-color: #fee;
+ color: #855;
 }

=== modified file 'lib/canonical/launchpad/security.py'
--- lib/canonical/launchpad/security.py 2009-12-10 12:46:11 +0000
+++ lib/canonical/launchpad/security.py 2009-12-11 11:33:39 +0000
@@ -1130,9 +1130,9 @@
             return True
         else:
             return (
- OnlyRosettaExpertsAndAdmins.checkAuthenticated(self, user) or
- EditDistributionByDistroOwnersOrAdmins.checkAuthenticated(
- self, user))
+ OnlyRosettaExpertsAndAdmins.checkAuthenticated(self, user) or
+ EditDistributionByDistroOwnersOrAdmins.checkAuthenticated(
+ self, user))

 # Please keep AdminPOTemplateSubset in sync with this, unless you
@@ -1155,8 +1155,7 @@
             distribution = template.distroseries.distribution
             return (
                 AdminDistributionTranslations(
- template.distroseries.distribution).checkAuthenticated(
- user))
+ distribution).checkAuthenticated(user))

         else:
             # Template is on a product.
@@ -1663,16 +1662,13 @@
     def checkAuthenticated(self, user):
         template_set = self.obj
         if template_set.distroseries is not None:
- distro = template_set.distroseries.distribution
- translation_group = distro.translationgroup
- if translation_group and user.inTeam(translation_group.owner):
- return True
-
+ distribution = template_set.distroseries.distribution
             return (
                 AdminDistributionTranslations(
- template_set.distroseries.distribution).checkAuthenticated(user))
-
- return False
+ distribution).checkAuthenticated(user))
+ else:
+ # Template is on a product.
+ return OnlyRosettaExpertsAndAdmins.checkAuthenticated(self, user)

 class AdminDistroSeriesLanguage(OnlyRosettaExpertsAndAdmins):

=== modified file 'lib/lp/translations/stories/standalone/xx-potemplate-admin.txt'
--- lib/lp/translations/stories/standalone/xx-potemplate-admin.txt 2009-08-12 05:09:36 +0000
+++ lib/lp/translations/stories/standalone/xx-potemplate-admin.txt 2009-12-11 11:33:39 +0000
@@ -1,3 +1,10 @@
+Administering POTemplates
+=========================
+
+
+Product templates
+-----------------
+
 The POTemplate admin page lets us to edit any aspect of that object, that's
 why we need to be a Rosetta Expert or a Launchpad admin to use it.

@@ -155,8 +162,29 @@
   >>> print admin_browser.url
   http://translations.launchpad.dev/evolution/trunk/+pots/evolution-renamed

-
-== Distribution templates ==
+Administrators can disable and then make changes to a disabled template.
+
+ >>> admin_browser.open(
+ ... 'http://translations.launchpad.dev/evolution/trunk/+pots/'
+ ... 'evolution-renamed/+admin')
+ >>> admin_browser.getControl(name='field.iscurrent').value = False
+ >>> admin_browser.getControl('Change').click()
+ >>> print admin_browser.url
+ http://translations.launchpad.dev/evolution/trunk/+pots/evolution-renamed
+
+Now we will reenable the template.
+
+ >>> admin_browser.open(
+ ... 'http://translations.launchpad.dev/evolution/trunk/+pots/'
+ ... 'evolution-renamed/+admin')
+ >>> admin_browser.getControl(name='field.iscurrent').value = True
+ >>> admin_browser.getControl('Change').click()
+ >>> print admin_browser.url
+ http://translations.launchpad.dev/evolution/trunk/+pots/evolution-renamed
+
+
+Distribution templates
+----------------------

 Distributions get slightly wider permissions to manage their templates
 autonomously.
@@ -214,3 +242,15 @@

     >>> print template.path
     splat.pot
+
+Distribution translation coordinators can disable and manage disabled
+templates.
+
+ >>> group_owner_browser.open(template_admin_url)
+ >>> group_owner_browser.getControl(name='field.iscurrent').value = False
+ >>> group_owner_browser.getControl('Change').click()
+ >>> group_owner_browser.open(template_admin_url)
+ >>> group_owner_browser.getControl(name='field.iscurrent').value = True
+ >>> group_owner_browser.getControl('Change').click()
+
+

« Back to merge proposal