summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5359bed)
raw | patch | inline | side by side (parent: 5359bed)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 2 Aug 2001 05:55:25 +0000 (05:55 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Thu, 2 Aug 2001 05:55:25 +0000 (05:55 +0000) |
message is generated if they are the only person on the nosy list.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@192 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@192 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi_client.py | patch | blob | history |
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index 52e7cadc92eb62f9b78b81b47c6fcc5f49c6d784..3c497c068bb5ff3da8ab552cb4ac3abf673c172b 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
-# $Id: cgi_client.py,v 1.15 2001-08-02 00:34:10 richard Exp $
+# $Id: cgi_client.py,v 1.16 2001-08-02 05:55:25 richard Exp $
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
self.headers_done = 0
self.debug = 0
+ def getuid(self):
+ return self.db.user.lookup(self.user)
+
def header(self, headers={'Content-Type':'text/html'}):
if not headers.has_key('Content-Type'):
headers['Content-Type'] = 'text/html'
link = self.db.classes[link]
link.set(nodeid, **{property: nid})
- # if this item has messages,
- if (cl.getprops().has_key('messages') and
- cl.getprops()['messages'].isMultilinkType and
- cl.getprops()['messages'].classname == 'msg'):
+ # see if we want to send a message to the nosy list...
+ props = cl.getprops()
+ # don't do the message thing if there's no nosy list, or the editor
+ # of the node is the only person on the nosy list - they're already
+ # aware of the change.
+ nosy = 0
+ if props.has_key('nosy'):
+ nosy = cl.get(nid, 'nosy')
+ uid = self.getuid()
+ if len(nosy) == 1 and uid in nosy:
+ nosy = 0
+ if (nosy and props.has_key('messages') and
+ props['messages'].isMultilinkType and
+ props['messages'].classname == 'msg'):
+
# handle the note
note = None
if self.form.has_key('__note'):
m.append('\n-------\n')
# generate an edit message - nosyreactor will send it
- for name, prop in cl.getprops().items():
- value = cl.get(nid, name)
+ for name, prop in props.items():
+ value = cl.get(nid, name, None)
if prop.isLinkType:
link = self.db.classes[prop.classname]
key = link.getkey()
else:
value = '-'
elif prop.isMultilinkType:
+ if value is None: value = []
l = []
link = self.db.classes[prop.classname]
for entry in value:
# now create the message
content = '\n'.join(m)
- message_id = self.db.msg.create(author='1', recipients=[],
- date=date.Date('.'), summary=summary, content=content)
+ nosy.remove(self.getuid())
+ message_id = self.db.msg.create(author=self.getuid(),
+ recipients=nosy, date=date.Date('.'), summary=summary,
+ content=content)
messages = cl.get(nid, 'messages')
messages.append(message_id)
props = {'messages': messages}
#
# $Log: not supported by cvs2svn $
+# Revision 1.15 2001/08/02 00:34:10 richard
+# bleah syntax error
+#
# Revision 1.14 2001/08/02 00:26:16 richard
# Changed the order of the information in the message generated by web edits.
#