=== added directory 'lib/canonical/launchpad/apidoc'
=== removed directory 'lib/canonical/launchpad/apidoc'
=== modified file 'lib/canonical/launchpad/mailnotification.py'
--- lib/canonical/launchpad/mailnotification.py	2010-02-11 14:04:16 +0000
+++ lib/canonical/launchpad/mailnotification.py	2010-05-25 22:32:33 +0000
@@ -344,6 +344,9 @@
 def update_security_contact_subscriptions(modified_bugtask, event):
     """Subscribe the new security contact when a bugtask's product changes.
 
+    Only subscribes the new security contact if the bug was marked a
+    security issue originally.
+
     No change is made for private bugs.
     """
     if event.object.bug.private:
@@ -358,7 +361,7 @@
     if (bugtask_before_modification.product !=
         bugtask_after_modification.product):
         new_product = bugtask_after_modification.product
-        if new_product.security_contact:
+        if bugtask_before_modification.bug.security_related and new_product.security_contact:
             bugtask_after_modification.bug.subscribe(
                 new_product.security_contact, IPerson(event.user))
 

=== modified file 'lib/lp/bugs/doc/security-teams.txt'
--- lib/lp/bugs/doc/security-teams.txt	2010-05-18 21:24:27 +0000
+++ lib/lp/bugs/doc/security-teams.txt	2010-05-25 22:32:33 +0000
@@ -207,8 +207,9 @@
     [u'name12', u'name16']
 
 Finally, reassigning a public bug to a different product will subscribe
-the new security contact, if present. Let's set stub to the security
-contact for thunderbird to see how this works.
+the new security contact, if present and if the original bug was marked
+as a security issue. Let's set stub to the security contact for
+thunderbird to see how this works.
 
     >>> thunderbird = productset.get(8)
     >>> print thunderbird.name
@@ -241,17 +242,40 @@
     >>> subscriber_names(bug)
     [u'name12', u'name16']
 
-But publish the same event again, when the bug is marked public, and
-stub will be added to the subscriber list:
+Also verify the same event again, when marked public does cause
+stub to get subscribed:
 
     >>> bug.setPrivate(False, getUtility(ILaunchBag).user)
     True
 
+    >>> bug.security_related
+    True
+
     >>> notify(bug_product_changed)
 
     >>> subscriber_names(bug)
     [u'name12', u'name16', u'stub']
 
+But if it is not a security issue originally, stub does not get
+subscribed when moving it to the new project.
+
+    >>> bug.unsubscribe(stub, stub)
+
+    >>> subscriber_names(bug)
+    [u'name12', u'name16']
+
+    >>> bug.setSecurityRelated(False)
+    True
+
+    >>> bug.security_related
+    False
+
+    >>> notify(bug_product_changed)
+
+    >>> subscriber_names(bug)
+    [u'name12', u'name16']
+
+
 When a bug becomes security-related, the security contacts for the pillars it
 affects are subscribed to it.
 

