From c1843f47f4f49a5988a8d765e488be953c59a600 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 29 Aug 2001 04:47:18 +0000 Subject: [PATCH] Fixed CGI client change messages so they actually include the properties changed (again). git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@243 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 2 +- INSTALL.txt | 6 ++++++ roundup/cgi_client.py | 25 ++++++++++++------------- roundup/hyperdb.py | 8 ++++++-- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 728b289..542044f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -13,7 +13,7 @@ Fixed: . 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: diff --git a/INSTALL.txt b/INSTALL.txt index 14f0ebf..f0d4eaa 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -72,6 +72,12 @@ The email addresses used by the system by default are: 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: diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py index c9ebcef..0e70d95 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.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 @@ class Client: 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 @@ class Client: 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 @@ class Client: 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 @@ class Client: # 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 @@ class Client: 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 @@ def parsePropsFromForm(cl, form, note_changed=0): 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. diff --git a/roundup/hyperdb.py b/roundup/hyperdb.py index 3cb774a..57a95b1 100644 --- a/roundup/hyperdb.py +++ b/roundup/hyperdb.py @@ -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 @@ class Class: 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 @@ def Choice(name, *options): # # $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 # -- 2.30.2