X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=roundup%2Fcgi_client.py;h=86177bb6b257e0978b35d5d4970cb982d5e404f7;hb=1b8dd00d357bfc90e4f1d57ac8c3dd36aa9a0ccd;hp=30c040346482f56280d2b669eae0721fc8772116;hpb=ca1a117664362e9c32a5ae869fa1df0b42224f4a;p=roundup.git diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index 30c0403..86177bb 100644 --- a/roundup/cgi_client.py +++ b/roundup/cgi_client.py @@ -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.89 2002-01-07 20:24:45 richard Exp $ +# $Id: cgi_client.py,v 1.90 2002-01-08 03:56:55 richard Exp $ __doc__ = """ WWW request handler (also used in the stand-alone server). @@ -350,6 +350,18 @@ class Client: showissue = shownode showmsg = shownode + def _add_assignedto_to_nosy(self, props): + ''' add the assignedto value from the props to the nosy list + ''' + if not props.has_key('assignedto'): + return + assignedto_id = props['assignedto'] + if props.has_key('nosy') and assignedto_id not in props['nosy']: + props['nosy'].append(assignedto_id) + else: + props['nosy'] = cl.get(self.nodeid, 'nosy') + props['nosy'].append(assignedto_id) + def _changenode(self, props): ''' change the node based on the contents of the form ''' @@ -361,16 +373,21 @@ class Client: resolved_id = self.db.status.lookup('resolved') chatting_id = self.db.status.lookup('chatting') current_status = cl.get(self.nodeid, 'status') + if props.has_key('status'): + new_status = props['status'] + else: + # apparently there's a chance that some browsers don't + # send status... + new_status = current_status except KeyError: pass else: - if (props['status'] == unread_id or props['status'] == resolved_id and current_status == resolved_id): + if new_status == unread_id or (new_status == resolved_id + and current_status == resolved_id): props['status'] = chatting_id - # add assignedto to the nosy list - if props.has_key('assignedto'): - assignedto_id = props['assignedto'] - if assignedto_id not in props['nosy']: - props['nosy'].append(assignedto_id) + + self._add_assignedto_to_nosy(props) + # create the message message, files = self._handle_message() if message: @@ -395,13 +412,9 @@ class Client: pass else: props['status'] = unread_id - # add assignedto to the nosy list - if props.has_key('assignedto'): - assignedto_id = props['assignedto'] - if props.has_key('nosy') and assignedto_id not in props['nosy']: - props['nosy'].append(assignedto_id) - else: - props['nosy'] = [assignedto_id] + + self._add_assignedto_to_nosy(props) + # check for messages and files message, files = self._handle_message() if message: @@ -1168,6 +1181,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0): # # $Log: not supported by cvs2svn $ +# Revision 1.89 2002/01/07 20:24:45 richard +# *mutter* stupid cutnpaste +# # Revision 1.88 2002/01/02 02:31:38 richard # Sorry for the huge checkin message - I was only intending to implement #496356 # but I found a number of places where things had been broken by transactions: