Skip to content

Commit 27654c9

Browse files
author
Richard Jones
committed
Fixed CGI client change messages...
...so they actually include the properties changed (again).
1 parent 00751d4 commit 27654c9

File tree

4 files changed

+25
-16
lines changed

4 files changed

+25
-16
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Fixed:
1313
. Missed some isFooType usages (thanks Mikhail Sobolev for spotting them)
1414
. Reverted back to sending change messages to the web editor of a node so
1515
that the change note message is actually genrated.
16-
16+
. CGI interface wasn't generating correct change messages.
1717

1818
2001-08-08 - 0.2.6
1919
Note:

INSTALL.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ The email addresses used by the system by default are:
7272
roundup-admin@MAIL_DOMAIN - roundup's internal use (problems, etc)
7373

7474

75+
Note:
76+
We run the instance as group "issue_tracker" and add the mail and web user
77+
("mail" and "apache" on our RedHat 7.1 system) to that group, as well as
78+
any admin people.
79+
80+
7581
Mail
7682
----
7783
Set up a mail alias called "issue_tracker" as:

roundup/cgi_client.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.22 2001-08-17 00:08:10 richard Exp $
18+
# $Id: cgi_client.py,v 1.23 2001-08-29 04:47:18 richard Exp $
1919

2020
import os, cgi, pprint, StringIO, urlparse, re, traceback, mimetypes
2121

@@ -199,7 +199,7 @@ def shownode(self, message=None):
199199
num_re = re.compile('^\d+$')
200200
if keys:
201201
try:
202-
props, changed = parsePropsFromForm(cl, self.form)
202+
props, changed = parsePropsFromForm(cl, self.form, self.nodeid)
203203
cl.set(self.nodeid, **props)
204204
self._post_editnode(self.nodeid, changed)
205205
# and some nice feedback for the user
@@ -276,14 +276,10 @@ def _post_editnode(self, nid, changes=None):
276276
link = self.db.classes[link]
277277
link.set(nodeid, **{property: nid})
278278

279-
# TODO: this should be an auditor
280-
# see if we want to send a message to the nosy list...
279+
# generate an edit message - nosyreactor will send it
280+
# don't bother if there's no messages or nosy list
281281
props = cl.getprops()
282-
# don't do the message thing if there's no nosy list
283-
nosy = 0
284-
if props.has_key('nosy'):
285-
nosy = cl.get(nid, 'nosy')
286-
nosy = len(nosy)
282+
nosy = len(cl.get(nid, 'nosy', []))
287283
if (nosy and props.has_key('messages') and
288284
isinstance(props['messages'], hyperdb.Multilink) and
289285
props['messages'].classname == 'msg'):
@@ -303,7 +299,6 @@ def _post_editnode(self, nid, changes=None):
303299
summary = 'This %s has been edited through the web.\n'%cn
304300
m = [summary]
305301

306-
# generate an edit message - nosyreactor will send it
307302
first = 1
308303
for name, prop in props.items():
309304
if changes is not None and name not in changes: continue
@@ -333,7 +328,7 @@ def _post_editnode(self, nid, changes=None):
333328

334329
# now create the message
335330
content = '\n'.join(m)
336-
message_id = self.db.msg.create(author=self.getuid(),
331+
message_id = self.db.msg.create(author='admin', #self.getuid(),
337332
recipients=[], date=date.Date('.'), summary=summary,
338333
content=content)
339334
messages = cl.get(nid, 'messages')
@@ -463,7 +458,7 @@ def main(self, dre=re.compile(r'([^\d]+)(\d+)'), nre=re.compile(r'new(\w+)')):
463458
def __del__(self):
464459
self.db.close()
465460

466-
def parsePropsFromForm(cl, form, note_changed=0):
461+
def parsePropsFromForm(cl, form, nodeid=0):
467462
'''Pull properties for the given class out of the form.
468463
'''
469464
props = {}
@@ -511,13 +506,17 @@ def parsePropsFromForm(cl, form, note_changed=0):
511506
value = l
512507
props[key] = value
513508
# if changed, set it
514-
if note_changed and value != cl.get(self.nodeid, key):
509+
if nodeid and value != cl.get(nodeid, key):
515510
changed.append(key)
516511
props[key] = value
517512
return props, changed
518513

519514
#
520515
# $Log: not supported by cvs2svn $
516+
# Revision 1.22 2001/08/17 00:08:10 richard
517+
# reverted back to sending messages always regardless of who is doing the web
518+
# edit. change notes weren't being saved. bleah. hackish.
519+
#
521520
# Revision 1.21 2001/08/15 23:43:18 richard
522521
# Fixed some isFooTypes that I missed.
523522
# Refactored some code in the CGI code.

roundup/hyperdb.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: hyperdb.py,v 1.18 2001-08-16 07:34:59 richard Exp $
18+
# $Id: hyperdb.py,v 1.19 2001-08-29 04:47:18 richard Exp $
1919

2020
# standard python modules
2121
import cPickle, re, string
@@ -265,7 +265,8 @@ class or a KeyError is raised.
265265
if not node.has_key(key):
266266
raise KeyError, key
267267

268-
if key == self.key:
268+
# check to make sure we're not duplicating an existing key
269+
if key == self.key and node[key] != value:
269270
try:
270271
self.lookup(value)
271272
except KeyError:
@@ -794,6 +795,9 @@ def Choice(name, *options):
794795

795796
#
796797
# $Log: not supported by cvs2svn $
798+
# Revision 1.18 2001/08/16 07:34:59 richard
799+
# better CGI text searching - but hidden filter fields are disappearing...
800+
#
797801
# Revision 1.17 2001/08/16 06:59:58 richard
798802
# all searches use re now - and they're all case insensitive
799803
#

0 commit comments

Comments
 (0)