Merge lp:~stevenk/launchpad/shift-ap-creation into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Steve Kowalik |
Approved revision: | no longer in the source branch. |
Merged at revision: | 15890 |
Proposed branch: | lp:~stevenk/launchpad/shift-ap-creation |
Merge into: | lp:launchpad |
Diff against target: |
140 lines (+30/-30) 3 files modified
lib/lp/registry/model/product.py (+18/-20) lib/lp/registry/tests/test_product.py (+9/-10) lib/lp/testing/factory.py (+3/-0) |
To merge this branch: | bzr merge lp:~stevenk/launchpad/shift-ap-creation |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+121985@code.launchpad.net |
Commit message
No longer create AccessPolicies in IProductSet.
Description of the change
Currently, when a new product is created, createProduct() will create PRIVATESECURITY and USERDATA AccessPolicies. This does not make sense if the product has its branch and bug sharing policies set to PROPRIETARY since the two that were created will just be cleaned up by a garbo job.
As such, stop creating them in createProduct(), and ensure they exist in setB{ranch,
I have deleted a test that no longer makes sense, since creating a product itself won't create APs.
+ def _check_ and_set_ sharing_ policy( self, var, enum, kind, allowed_types):
It doesn't actually set the sharing policy. It just prepares for it.
27 + if var != enum.PUBLIC: current_ commercial_ subscription:
28 + if not self.has_
This can be a single if statement now.
208 + return self.makeProduc t(skip_ sharing_ policy= True, **kwargs)
Privacy relies on the APs existing, so you can't set skip_sharing_policy unconditionally here. I think it'd be better to have the one or two tests that need it remove the APs themselves, rather than preventing them from being created in the first place.