Skip to content

Commit bf5a5a9

Browse files
author
Richard Jones
committed
Added the ADD_AUTHOR_TO_NOSY handling to the CGI interface.
1 parent 54cec46 commit bf5a5a9

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

roundup/cgi_client.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.115 2002-04-02 01:56:10 richard Exp $
18+
# $Id: cgi_client.py,v 1.116 2002-05-02 08:07:49 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -557,6 +557,25 @@ def shownode(self, message=None):
557557
showissue = shownode
558558
showmsg = shownode
559559

560+
def _add_author_to_nosy(self, props):
561+
''' add the author value from the props to the nosy list
562+
'''
563+
if not props.has_key('author'):
564+
return
565+
author_id = props['author']
566+
if not props.has_key('nosy'):
567+
# load current nosy
568+
if self.nodeid:
569+
cl = self.db.classes[self.classname]
570+
l = cl.get(self.nodeid, 'nosy')
571+
if author_id in l:
572+
return
573+
props['nosy'] = l
574+
else:
575+
props['nosy'] = []
576+
if author_id not in props['nosy']:
577+
props['nosy'].append(author_id)
578+
560579
def _add_assignedto_to_nosy(self, props):
561580
''' add the assignedto value from the props to the nosy list
562581
'''
@@ -602,6 +621,10 @@ def _changenode(self, props):
602621

603622
self._add_assignedto_to_nosy(props)
604623

624+
# possibly add the author of the change to the nosy list
625+
if self.db.config.ADD_AUTHOR_TO_NOSY == 'yes':
626+
self._add_author_to_nosy(props)
627+
605628
# create the message
606629
message, files = self._handle_message()
607630
if message:
@@ -630,6 +653,10 @@ def _createnode(self):
630653

631654
self._add_assignedto_to_nosy(props)
632655

656+
# possibly add the author of the new node to the nosy list
657+
if self.db.config.ADD_AUTHOR_TO_NOSY in ('new', 'yes'):
658+
self._add_author_to_nosy(props)
659+
633660
# check for messages and files
634661
message, files = self._handle_message()
635662
if message:
@@ -1357,6 +1384,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
13571384

13581385
#
13591386
# $Log: not supported by cvs2svn $
1387+
# Revision 1.115 2002/04/02 01:56:10 richard
1388+
# . stop sending blank (whitespace-only) notes
1389+
#
13601390
# Revision 1.114 2002/03/17 23:06:05 richard
13611391
# oops
13621392
#

0 commit comments

Comments
 (0)