launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #11863
[Merge] lp:~rharding/launchpad/updated_product_allowed_types into lp:launchpad
Richard Harding has proposed merging lp:~rharding/launchpad/updated_product_allowed_types into lp:launchpad with lp:~rharding/launchpad/pp_register as a prerequisite.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~rharding/launchpad/updated_product_allowed_types/+merge/123987
= Summary =
A constant was added that lists the information types needed for Product.
Change to using that.
== Pre Implementation ==
Discussed on our stand up that this was a simpler method of getting the types
into the choice widget.
== Implementation Notes ==
Simple case of removing the old code, change to the constant from the enums.
--
https://code.launchpad.net/~rharding/launchpad/updated_product_allowed_types/+merge/123987
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~rharding/launchpad/updated_product_allowed_types into lp:launchpad.
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2012-09-12 15:19:30 +0000
+++ lib/lp/registry/browser/product.py 2012-09-12 15:19:31 +0000
@@ -162,6 +162,7 @@
InformationType,
PRIVATE_INFORMATION_TYPES,
PUBLIC_INFORMATION_TYPES,
+ PUBLIC_PROPRIETARY_INFORMATION_TYPES,
)
from lp.registry.interfaces.pillar import IPillarNameSet
from lp.registry.interfaces.product import (
@@ -2040,7 +2041,7 @@
'name': term.title,
'description_css_class': 'choice-description'}
for term in
- self.context.getAllowedProductInformationTypes()]
+ lp.registry.enums.PUBLIC_PROPRIETARY_INFORMATION_TYPES]
super(ProjectAddStepTwo, self).initialize()
=== modified file 'lib/lp/registry/interfaces/product.py'
--- lib/lp/registry/interfaces/product.py 2012-09-12 15:19:30 +0000
+++ lib/lp/registry/interfaces/product.py 2012-09-12 15:19:31 +0000
@@ -974,12 +974,6 @@
returned.
"""
- def getAllowedProductInformationTypes():
- """Get the information types that a project can have.
-
- :return: A sequence of `InformationType`s.
- """
-
@call_with(owner=REQUEST_USER)
@rename_parameters_as(
displayname='display_name', project='project_group',
=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py 2012-09-12 15:19:30 +0000
+++ lib/lp/registry/model/product.py 2012-09-12 15:19:31 +0000
@@ -1560,12 +1560,6 @@
results = results.limit(num_products)
return results
- def getAllowedProductInformationTypes(self):
- """See `IProductSet`."""
- return (InformationType.PUBLIC,
- InformationType.EMBARGOED,
- InformationType.PROPRIETARY)
-
def createProduct(self, owner, name, displayname, title, summary,
description=None, project=None, homepageurl=None,
screenshotsurl=None, wikiurl=None,
Follow ups