Remove unused classed from security.py and refactor
== Pre-implementation notes ==
Talking with Henning we decide not to include security checking code in the model. This is why the logic of showing translations of a series was spitted between the model and the view and the security checks were done in multiple places.
This restriction lead to a strange implementation where the check was done both in the view and the model and it was a source of confusion.
I merged this logic in a browser helper function and now the security check is only done once.
== Implementation details ==
These changes renders the AdminDistroSeriesLanguage class from security.py useless, so I have also removed it.
lib/lp/registry/browser/sourcepackage.py
29: [F0401] Unable to import 'lazr.restful.interface' (No module named restful)
lib/lp/registry/interfaces/distroseries.py
23: [F0401] Unable to import 'lazr.enum' (No module named enum)
50: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)
51: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)
117: [E1002, DistroSeriesVersionField._validate] Use super on an old style class
447: [C0322, IDistroSeriesPublic.getPackageUploads] Operator not preceded by a space
description=_("Return items that are more recent than this "
^
"timestamp."),
required=False),
status=Choice(
vocabulary=DBEnumeratedType,
title=_("Package Upload Status"),
description=_("Return only items that have this status."),
required=False),
archive=Reference(
schema=Interface,
title=_("Archive"),
description=_("Return only items for this archive."),
required=False),
pocket=Choice(
vocabulary=DBEnumeratedType,
title=_("Pocket"),
description=_("Return only items targeted to this pocket"),
required=False),
custom_type=Choice(
vocabulary=DBEnumeratedType,
title=_("Custom Type"),
description=_("Return only items with custom files of this "
"type."),
required=False),
)
= Bug 509252 = /code.edge. launchpad. net/~adiroiban/ launchpad/ bug-340662- take-2/ +merge/ 17598) the POTemplateSubse tNavigation will render the AdminPOTemplate Subset useless.
After landing the fix for bug 340662 (https:/
We should clean the security.py.
AdminPOTemplate Subset was added to fix bug 497438
== Proposed fix ==
Remove unused classed from security.py and refactor
== Pre-implementation notes ==
Talking with Henning we decide not to include security checking code in the model. This is why the logic of showing translations of a series was spitted between the model and the view and the security checks were done in multiple places.
This restriction lead to a strange implementation where the check was done both in the view and the model and it was a source of confusion.
I merged this logic in a browser helper function and now the security check is only done once.
== Implementation details ==
These changes renders the AdminDistroSeri esLanguage class from security.py useless, so I have also removed it.
== Tests == translations -t distroseries-views
lp-test -t distroseries-
== Demo and Q/A == l10n-coordinato r). /launchpad. dev/~ubuntu- l10n-coordinato r
Make sure you are a member of Ubuntu Translation Coordinators team (ubuntu-
https:/
Go to the translation page for a distribution and hide translations for this series /translations. launchpad. dev/ubuntu/ hoary/+ admin
ie: https:/
Next go to the distribution series +template page /translations. launchpad. dev/ubuntu/ hoary/+ templates
https:/
You should see the Administer page for Evolution templates, including disabled-template .
As a member of Ubuntu Translation Coordinators team you should be able to administer them, just like for a normal series.
Login as a normal user you should see a page informing that the translations are currently closed
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: /launchpad/ security. py registry/ browser/ distroseries. py registry/ browser/ sourcepackage. py registry/ interfaces/ distroseries. py registry/ model/distroser ies.py translations/ browser/ browser_ helpers. py translations/ browser/ distroseries. py translations/ stories/ distroseries/ xx-distroseries -translations. txt
lib/canonical
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
== Pylint notices ==
lib/lp/ registry/ browser/ sourcepackage. py interface' (No module named restful)
29: [F0401] Unable to import 'lazr.restful.
lib/lp/ registry/ interfaces/ distroseries. py fields' (No module named restful) declarations' (No module named restful) sionField. _validate] Use super on an old style class blic.getPackage Uploads] Operator not preceded by a space =_("Return items that are more recent than this " False),
23: [F0401] Unable to import 'lazr.enum' (No module named enum)
50: [F0401] Unable to import 'lazr.restful.
51: [F0401] Unable to import 'lazr.restful.
117: [E1002, DistroSeriesVer
447: [C0322, IDistroSeriesPu
description
^
"timestamp."),
required=
status=Choice(
vocabulary= DBEnumeratedTyp e, _("Package Upload Status"), =_("Return only items that have this status."), False), Reference(
title=
description
required=
archive=
schema= Interface, _("Archive" ), =_("Return only items for this archive."), False),
title=
description
required=
pocket=Choice(
vocabulary= DBEnumeratedTyp e, _("Pocket" ), =_("Return only items targeted to this pocket"), False), type=Choice(
title=
description
required=
custom_
vocabulary= DBEnumeratedTyp e, =_("Return only items with custom files of this " False),
title=_("Custom Type"),
description
"type."),
required=
)
@operation_ returns_ collection_ of(Interface) read_operation( ) ds(created_ since_date, status, archive, pocket,
@export_
def getPackageUploa
custom_type):
lib/lp/ registry/ model/distroser ies.py
1941: [C0301] Line too long (79/78)