1- # $Id: cgi_client.py,v 1.16 2001-08-02 05:55:25 richard Exp $
1+ # $Id: cgi_client.py,v 1.17 2001-08-02 06:38:17 richard Exp $
22
33import os , cgi , pprint , StringIO , urlparse , re , traceback , mimetypes
44
@@ -229,7 +229,7 @@ def shownode(self, message=None):
229229 props [key ] = value
230230 cl .set (self .nodeid , ** props )
231231
232- self ._post_editnode (self .nodeid )
232+ self ._post_editnode (self .nodeid , changed )
233233 # and some nice feedback for the user
234234 message = '%s edited ok' % ', ' .join (changed )
235235 except :
@@ -320,7 +320,7 @@ def _createnode(self):
320320 props [key ] = value
321321 return cl .create (** props )
322322
323- def _post_editnode (self , nid ):
323+ def _post_editnode (self , nid , changes = None ):
324324 ''' do the linking and message sending part of the node creation
325325 '''
326326 cn = self .classname
@@ -374,16 +374,20 @@ def _post_editnode(self, nid):
374374 summary = note
375375 m = ['%s\n ' % note ]
376376 else :
377- summary = 'This %s has been created through the web.\n ' % cn
377+ summary = 'This %s has been edited through the web.\n ' % cn
378378 m = [summary ]
379- m .append ('\n -------\n ' )
380379
381380 # generate an edit message - nosyreactor will send it
381+ first = 1
382382 for name , prop in props .items ():
383+ if changes is not None and name not in changes : continue
384+ if first :
385+ m .append ('\n -------' )
386+ first = 0
383387 value = cl .get (nid , name , None )
384388 if prop .isLinkType :
385389 link = self .db .classes [prop .classname ]
386- key = link .getkey ( )
390+ key = link .labelprop ( default_to_id = 1 )
387391 if value is not None and key :
388392 value = link .get (value , key )
389393 else :
@@ -392,8 +396,8 @@ def _post_editnode(self, nid):
392396 if value is None : value = []
393397 l = []
394398 link = self .db .classes [prop .classname ]
399+ key = link .labelprop (default_to_id = 1 )
395400 for entry in value :
396- key = link .getkey ()
397401 if key :
398402 l .append (link .get (entry , link .getkey ()))
399403 else :
@@ -403,9 +407,8 @@ def _post_editnode(self, nid):
403407
404408 # now create the message
405409 content = '\n ' .join (m )
406- nosy .remove (self .getuid ())
407410 message_id = self .db .msg .create (author = self .getuid (),
408- recipients = nosy , date = date .Date ('.' ), summary = summary ,
411+ recipients = [] , date = date .Date ('.' ), summary = summary ,
409412 content = content )
410413 messages = cl .get (nid , 'messages' )
411414 messages .append (message_id )
@@ -536,6 +539,10 @@ def __del__(self):
536539
537540#
538541# $Log: not supported by cvs2svn $
542+ # Revision 1.16 2001/08/02 05:55:25 richard
543+ # Web edit messages aren't sent to the person who did the edit any more. No
544+ # message is generated if they are the only person on the nosy list.
545+ #
539546# Revision 1.15 2001/08/02 00:34:10 richard
540547# bleah syntax error
541548#
0 commit comments