Skip to content

Commit 660e336

Browse files
author
Richard Jones
committed
Oops, missed this before the beta: [SF#495392] empty nosy -patch
1 parent 123b3a0 commit 660e336

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed

roundup/cgi_client.py

Lines changed: 30 additions & 14 deletions
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.89 2002-01-07 20:24:45 richard Exp $
18+
# $Id: cgi_client.py,v 1.90 2002-01-08 03:56:55 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -350,6 +350,18 @@ def shownode(self, message=None):
350350
showissue = shownode
351351
showmsg = shownode
352352

353+
def _add_assignedto_to_nosy(self, props):
354+
''' add the assignedto value from the props to the nosy list
355+
'''
356+
if not props.has_key('assignedto'):
357+
return
358+
assignedto_id = props['assignedto']
359+
if props.has_key('nosy') and assignedto_id not in props['nosy']:
360+
props['nosy'].append(assignedto_id)
361+
else:
362+
props['nosy'] = cl.get(self.nodeid, 'nosy')
363+
props['nosy'].append(assignedto_id)
364+
353365
def _changenode(self, props):
354366
''' change the node based on the contents of the form
355367
'''
@@ -361,16 +373,21 @@ def _changenode(self, props):
361373
resolved_id = self.db.status.lookup('resolved')
362374
chatting_id = self.db.status.lookup('chatting')
363375
current_status = cl.get(self.nodeid, 'status')
376+
if props.has_key('status'):
377+
new_status = props['status']
378+
else:
379+
# apparently there's a chance that some browsers don't
380+
# send status...
381+
new_status = current_status
364382
except KeyError:
365383
pass
366384
else:
367-
if (props['status'] == unread_id or props['status'] == resolved_id and current_status == resolved_id):
385+
if new_status == unread_id or (new_status == resolved_id
386+
and current_status == resolved_id):
368387
props['status'] = chatting_id
369-
# add assignedto to the nosy list
370-
if props.has_key('assignedto'):
371-
assignedto_id = props['assignedto']
372-
if assignedto_id not in props['nosy']:
373-
props['nosy'].append(assignedto_id)
388+
389+
self._add_assignedto_to_nosy(props)
390+
374391
# create the message
375392
message, files = self._handle_message()
376393
if message:
@@ -395,13 +412,9 @@ def _createnode(self):
395412
pass
396413
else:
397414
props['status'] = unread_id
398-
# add assignedto to the nosy list
399-
if props.has_key('assignedto'):
400-
assignedto_id = props['assignedto']
401-
if props.has_key('nosy') and assignedto_id not in props['nosy']:
402-
props['nosy'].append(assignedto_id)
403-
else:
404-
props['nosy'] = [assignedto_id]
415+
416+
self._add_assignedto_to_nosy(props)
417+
405418
# check for messages and files
406419
message, files = self._handle_message()
407420
if message:
@@ -1168,6 +1181,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
11681181

11691182
#
11701183
# $Log: not supported by cvs2svn $
1184+
# Revision 1.89 2002/01/07 20:24:45 richard
1185+
# *mutter* stupid cutnpaste
1186+
#
11711187
# Revision 1.88 2002/01/02 02:31:38 richard
11721188
# Sorry for the huge checkin message - I was only intending to implement #496356
11731189
# but I found a number of places where things had been broken by transactions:

0 commit comments

Comments
 (0)