[CMF-checkins] CVS: CMF/CMFCollector - CollectorIssue.py:1.38.16.1

Shane Hathaway shane@cvs.zope.org
Wed, 20 Feb 2002 15:15:21 -0500


Update of /cvs-repository/CMF/CMFCollector
In directory cvs.zope.org:/tmp/cvs-serv27999/CMFCollector

Modified Files:
      Tag: cmf-pre-1_3-branch
	CollectorIssue.py 
Log Message:
Merged changes from head, with a small change: the types tool does not need
to be extended in such a complex way.  I took out the type_type registry and
the __bobo_traverse__ hook and replaced it with the original code with only
minor mods that give you the same extensibility without all the hacking.
(If anyone actually wants to use the extensibility, which I suspect no one
is actually interested in doing, I will happily provide instructions and
will create a corrected unit test.)


=== CMF/CMFCollector/CollectorIssue.py 1.38 => 1.38.16.1 ===
     def _send_update_notice(self, action, actor,
                             orig_status=None, additions=None, removals=None,
-                            file=None, fileid=None):
+                            file=None, fileid=None, lower=string.lower):
         """Send email notification about issue event to relevant parties."""
 
         action = string.capitalize(string.split(action, '_')[0])
-        new_status = string.split(self.status(), '_')[0]
+        new_status = self.status()
 
         recipients = []
 
@@ -406,16 +406,24 @@
         # - Person taking action always
         # - Supporters assigned to the issue always
         # - Managers or managers + all supporters (according to dispatching):
-        #   - When an issue is any state besides accepted
-        #   - When an issue is being accepted
-        #   - When an issue is accepted and moving to another state
+        #   - When in any state besides accepted (or accepted_confidential)
+        #   - When being accepted (or accepted_confidential)
+        #   - When is accepted (or accepted_confidential) and moving to
+        #     another state 
         # - Any supporters being removed from the issue by the current action
+        # - In addition, any destinations for the resulting state registered
+        #   in state_email are included.
         #
-        # We're liberal about duplicates - they'll be filtered before send.
+        # We're liberal about allowing duplicates in the collection phase -
+        # all duplicate addresses will be filtered out before actual send.
 
         candidates = [self.submitter_id, actor] + list(self.assigned_to())
-        if orig_status and not ('accepted' == string.lower(new_status) == 
-                                string.lower(orig_status)):
+        continuing_accepted = (lower(orig_status) in ['accepted',
+                                                      'accepted_confidential']
+                               and
+                               lower(new_status) in ['accepted',
+                                                     'accepted_confidential'])
+        if orig_status and not continuing_accepted:
             candidates.extend(self.aq_parent.managers)
             if not self.aq_parent.dispatching:
                 candidates.extend(self.aq_parent.supporters)