← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/deprecate-private-bugs into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/deprecate-private-bugs into lp:launchpad.

Commit message:
A couple of legacy privacy cleanups: deprecate Product.private_bugs on the API, and make *_sharing_policy mandatory fields.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/deprecate-private-bugs/+merge/129108

A couple of legacy privacy cleanups: deprecate Product.private_bugs on the API, and make *_sharing_policy mandatory fields.
-- 
https://code.launchpad.net/~wgrant/launchpad/deprecate-private-bugs/+merge/129108
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/deprecate-private-bugs into lp:launchpad.
=== modified file 'lib/lp/registry/interfaces/product.py'
--- lib/lp/registry/interfaces/product.py	2012-10-11 04:21:07 +0000
+++ lib/lp/registry/interfaces/product.py	2012-10-11 08:02:20 +0000
@@ -626,24 +626,26 @@
         description=_("Whether or not this project's attributes are "
                       "updated automatically."))
 
-    private_bugs = exported(Bool(title=_('Private bugs'), readonly=True,
-                        description=_(
-                            "Whether or not bugs reported into this project "
-                            "are private by default.")))
+    private_bugs = exported(
+        Bool(
+            title=_('Private bugs (obsolete; always False)'), readonly=True,
+            description=_("Replaced by bug_sharing_policy.")),
+        ('devel', dict(exported=False)))
+
     branch_sharing_policy = exported(Choice(
         title=_('Branch sharing policy'),
         description=_("Sharing policy for this project's branches."),
-        required=False, readonly=True, vocabulary=BranchSharingPolicy),
+        required=True, readonly=True, vocabulary=BranchSharingPolicy),
         as_of='devel')
     bug_sharing_policy = exported(Choice(
         title=_('Bug sharing policy'),
         description=_("Sharing policy for this project's bugs."),
-        required=False, readonly=True, vocabulary=BugSharingPolicy),
+        required=True, readonly=True, vocabulary=BugSharingPolicy),
         as_of='devel')
     specification_sharing_policy = exported(Choice(
         title=_('Specification sharing policy'),
         description=_("Sharing policy for this project's specifications."),
-        required=False, readonly=True, vocabulary=SpecificationSharingPolicy),
+        required=True, readonly=True, vocabulary=SpecificationSharingPolicy),
         as_of='devel')
 
     licenses = exported(

=== modified file 'lib/lp/registry/model/product.py'
--- lib/lp/registry/model/product.py	2012-10-11 04:21:07 +0000
+++ lib/lp/registry/model/product.py	2012-10-11 08:02:20 +0000
@@ -641,16 +641,11 @@
 
     def getAllowedBugInformationTypes(self):
         """See `IProduct.`"""
-        if self.bug_sharing_policy is not None:
-            return BUG_POLICY_ALLOWED_TYPES[self.bug_sharing_policy]
-        return FREE_INFORMATION_TYPES
+        return BUG_POLICY_ALLOWED_TYPES[self.bug_sharing_policy]
 
     def getDefaultBugInformationType(self):
         """See `IProduct.`"""
-        if self.bug_sharing_policy is not None:
-            return BUG_POLICY_DEFAULT_TYPES[self.bug_sharing_policy]
-        else:
-            return InformationType.PUBLIC
+        return BUG_POLICY_DEFAULT_TYPES[self.bug_sharing_policy]
 
     def getAllowedSpecificationInformationTypes(self):
         """See `ISpecificationTarget`."""


Follow ups