Mercurial > p > roundup > code
changeset 236:8827f5931ea8
Fixed CGI client change messages...
...so they actually include the properties changed (again).
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 29 Aug 2001 04:47:18 +0000 |
| parents | d7d358408537 |
| children | 9ccdd87dc4d3 |
| files | CHANGES.txt INSTALL.txt roundup/cgi_client.py roundup/hyperdb.py |
| diffstat | 4 files changed, 25 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Tue Aug 28 05:58:33 2001 +0000 +++ b/CHANGES.txt Wed Aug 29 04:47:18 2001 +0000 @@ -13,7 +13,7 @@ . Missed some isFooType usages (thanks Mikhail Sobolev for spotting them) . Reverted back to sending change messages to the web editor of a node so that the change note message is actually genrated. - + . CGI interface wasn't generating correct change messages. 2001-08-08 - 0.2.6 Note:
--- a/INSTALL.txt Tue Aug 28 05:58:33 2001 +0000 +++ b/INSTALL.txt Wed Aug 29 04:47:18 2001 +0000 @@ -72,6 +72,12 @@ roundup-admin@MAIL_DOMAIN - roundup's internal use (problems, etc) +Note: +We run the instance as group "issue_tracker" and add the mail and web user +("mail" and "apache" on our RedHat 7.1 system) to that group, as well as +any admin people. + + Mail ---- Set up a mail alias called "issue_tracker" as:
--- a/roundup/cgi_client.py Tue Aug 28 05:58:33 2001 +0000 +++ b/roundup/cgi_client.py Wed Aug 29 04:47:18 2001 +0000 @@ -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.22 2001-08-17 00:08:10 richard Exp $ +# $Id: cgi_client.py,v 1.23 2001-08-29 04:47:18 richard Exp $ import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes @@ -199,7 +199,7 @@ num_re = re.compile('^\d+$') if keys: try: - props, changed = parsePropsFromForm(cl, self.form) + props, changed = parsePropsFromForm(cl, self.form, self.nodeid) cl.set(self.nodeid, **props) self._post_editnode(self.nodeid, changed) # and some nice feedback for the user @@ -276,14 +276,10 @@ link = self.db.classes[link] link.set(nodeid, **{property: nid}) - # TODO: this should be an auditor - # see if we want to send a message to the nosy list... + # generate an edit message - nosyreactor will send it + # don't bother if there's no messages or nosy list props = cl.getprops() - # don't do the message thing if there's no nosy list - nosy = 0 - if props.has_key('nosy'): - nosy = cl.get(nid, 'nosy') - nosy = len(nosy) + nosy = len(cl.get(nid, 'nosy', [])) if (nosy and props.has_key('messages') and isinstance(props['messages'], hyperdb.Multilink) and props['messages'].classname == 'msg'): @@ -303,7 +299,6 @@ summary = 'This %s has been edited through the web.\n'%cn m = [summary] - # generate an edit message - nosyreactor will send it first = 1 for name, prop in props.items(): if changes is not None and name not in changes: continue @@ -333,7 +328,7 @@ # now create the message content = '\n'.join(m) - message_id = self.db.msg.create(author=self.getuid(), + message_id = self.db.msg.create(author='admin', #self.getuid(), recipients=[], date=date.Date('.'), summary=summary, content=content) messages = cl.get(nid, 'messages') @@ -463,7 +458,7 @@ def __del__(self): self.db.close() -def parsePropsFromForm(cl, form, note_changed=0): +def parsePropsFromForm(cl, form, nodeid=0): '''Pull properties for the given class out of the form. ''' props = {} @@ -511,13 +506,17 @@ value = l props[key] = value # if changed, set it - if note_changed and value != cl.get(self.nodeid, key): + if nodeid and value != cl.get(nodeid, key): changed.append(key) props[key] = value return props, changed # # $Log: not supported by cvs2svn $ +# Revision 1.22 2001/08/17 00:08:10 richard +# reverted back to sending messages always regardless of who is doing the web +# edit. change notes weren't being saved. bleah. hackish. +# # Revision 1.21 2001/08/15 23:43:18 richard # Fixed some isFooTypes that I missed. # Refactored some code in the CGI code.
--- a/roundup/hyperdb.py Tue Aug 28 05:58:33 2001 +0000 +++ b/roundup/hyperdb.py Wed Aug 29 04:47:18 2001 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: hyperdb.py,v 1.18 2001-08-16 07:34:59 richard Exp $ +# $Id: hyperdb.py,v 1.19 2001-08-29 04:47:18 richard Exp $ # standard python modules import cPickle, re, string @@ -265,7 +265,8 @@ if not node.has_key(key): raise KeyError, key - if key == self.key: + # check to make sure we're not duplicating an existing key + if key == self.key and node[key] != value: try: self.lookup(value) except KeyError: @@ -794,6 +795,9 @@ # # $Log: not supported by cvs2svn $ +# Revision 1.18 2001/08/16 07:34:59 richard +# better CGI text searching - but hidden filter fields are disappearing... +# # Revision 1.17 2001/08/16 06:59:58 richard # all searches use re now - and they're all case insensitive #
