changeset 701:8d1e34b8e680

Added the ADD_AUTHOR_TO_NOSY handling to the CGI interface.
author Richard Jones <richard@users.sourceforge.net>
date Thu, 02 May 2002 08:07:49 +0000
parents 4f9686134fef
children 7ba403bffed5
files roundup/cgi_client.py
diffstat 1 files changed, 31 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi_client.py	Thu May 02 07:59:10 2002 +0000
+++ b/roundup/cgi_client.py	Thu May 02 08:07:49 2002 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: cgi_client.py,v 1.115 2002-04-02 01:56:10 richard Exp $
+# $Id: cgi_client.py,v 1.116 2002-05-02 08:07:49 richard Exp $
 
 __doc__ = """
 WWW request handler (also used in the stand-alone server).
@@ -557,6 +557,25 @@
     showissue = shownode
     showmsg = shownode
 
+    def _add_author_to_nosy(self, props):
+        ''' add the author value from the props to the nosy list
+        '''
+        if not props.has_key('author'):
+            return
+        author_id = props['author']
+        if not props.has_key('nosy'):
+            # load current nosy
+            if self.nodeid:
+                cl = self.db.classes[self.classname]
+                l = cl.get(self.nodeid, 'nosy')
+                if author_id in l:
+                    return
+                props['nosy'] = l
+            else:
+                props['nosy'] = []
+        if author_id not in props['nosy']:
+            props['nosy'].append(author_id)
+
     def _add_assignedto_to_nosy(self, props):
         ''' add the assignedto value from the props to the nosy list
         '''
@@ -602,6 +621,10 @@
 
         self._add_assignedto_to_nosy(props)
 
+        # possibly add the author of the change to the nosy list
+        if self.db.config.ADD_AUTHOR_TO_NOSY == 'yes':
+            self._add_author_to_nosy(props)
+
         # create the message
         message, files = self._handle_message()
         if message:
@@ -630,6 +653,10 @@
 
         self._add_assignedto_to_nosy(props)
 
+        # possibly add the author of the new node to the nosy list
+        if self.db.config.ADD_AUTHOR_TO_NOSY in ('new', 'yes'):
+            self._add_author_to_nosy(props)
+
         # check for messages and files
         message, files = self._handle_message()
         if message:
@@ -1357,6 +1384,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.115  2002/04/02 01:56:10  richard
+#  . stop sending blank (whitespace-only) notes
+#
 # Revision 1.114  2002/03/17 23:06:05  richard
 # oops
 #

Roundup Issue Tracker: http://roundup-tracker.org/