|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
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 $ |
19 | 19 |
|
20 | 20 | __doc__ = """ |
21 | 21 | WWW request handler (also used in the stand-alone server). |
@@ -557,6 +557,25 @@ def shownode(self, message=None): |
557 | 557 | showissue = shownode |
558 | 558 | showmsg = shownode |
559 | 559 |
|
| 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 | + |
560 | 579 | def _add_assignedto_to_nosy(self, props): |
561 | 580 | ''' add the assignedto value from the props to the nosy list |
562 | 581 | ''' |
@@ -602,6 +621,10 @@ def _changenode(self, props): |
602 | 621 |
|
603 | 622 | self._add_assignedto_to_nosy(props) |
604 | 623 |
|
| 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 | + |
605 | 628 | # create the message |
606 | 629 | message, files = self._handle_message() |
607 | 630 | if message: |
@@ -630,6 +653,10 @@ def _createnode(self): |
630 | 653 |
|
631 | 654 | self._add_assignedto_to_nosy(props) |
632 | 655 |
|
| 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 | + |
633 | 660 | # check for messages and files |
634 | 661 | message, files = self._handle_message() |
635 | 662 | if message: |
@@ -1357,6 +1384,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0): |
1357 | 1384 |
|
1358 | 1385 | # |
1359 | 1386 | # $Log: not supported by cvs2svn $ |
| 1387 | +# Revision 1.115 2002/04/02 01:56:10 richard |
| 1388 | +# . stop sending blank (whitespace-only) notes |
| 1389 | +# |
1360 | 1390 | # Revision 1.114 2002/03/17 23:06:05 richard |
1361 | 1391 | # oops |
1362 | 1392 | # |
|
0 commit comments