summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74c46ac)
raw | patch | inline | side by side (parent: 74c46ac)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 11 Jan 2002 23:22:29 +0000 (23:22 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 11 Jan 2002 23:22:29 +0000 (23:22 +0000) |
in short, the nosy reactor was modifying the nosy list. That code had
been there for a long time, and I suspsect it was there because we
weren't generating the nosy list correctly in other places of the code.
We're now doing that, so the nosy-modifying code can go away from the
nosy reactor.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@534 57a73879-2fb5-44c3-a270-3262357dd7e2
been there for a long time, and I suspsect it was there because we
weren't generating the nosy list correctly in other places of the code.
We're now doing that, so the nosy-modifying code can go away from the
nosy reactor.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@534 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index 02a98e9f3d196f4b1eccceff9f83484398d4654b..4179e812d55c01197237138ba718c1cad5f1d41a 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
. missed a "from i18n import _" in date.py
. #501690 ] MIGRATION.txt incomplete
. #502342 ] pipe interface
+ . #502437 ] rogue reactor and unittest
2002-01-08 - 0.4.0b1
Feature:
diff --git a/roundup/cgi_client.py b/roundup/cgi_client.py
index 2fef807d88188dd5d9ad8283518ee0504de7afc9..d53b02dbfae8224a5c6b426e3afd4982934f98db 100644 (file)
--- a/roundup/cgi_client.py
+++ b/roundup/cgi_client.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: cgi_client.py,v 1.96 2002-01-10 05:26:10 richard Exp $
+# $Id: cgi_client.py,v 1.97 2002-01-11 23:22:29 richard Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
return cl.create(**props)
def _handle_message(self):
- ''' generate and edit message
+ ''' generate an edit message
'''
# handle file attachments
files = []
#
# $Log: not supported by cvs2svn $
+# Revision 1.96 2002/01/10 05:26:10 richard
+# missed a parsePropsFromForm in last update
+#
# Revision 1.95 2002/01/10 03:39:45 richard
# . fixed some problems with web editing and change detection
#
diff --git a/roundup/templates/classic/detectors/nosyreaction.py b/roundup/templates/classic/detectors/nosyreaction.py
index 1088aa09c4edee5b86950942f1acb1614a706b56..46099e2b462c839f1c941b5759141a8a0a9b7abc 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: nosyreaction.py,v 1.9 2001-12-15 19:24:39 rochecompaan Exp $
+#$Id: nosyreaction.py,v 1.10 2002-01-11 23:22:29 richard Exp $
from roundup import roundupdb
except roundupdb.MessageSendError, message:
raise roundupdb.DetectorError, message
- # update the nosy list with the recipients from the new messages
- nosy = cl.get(nodeid, 'nosy')
- n = {}
- for nosyid in nosy: n[nosyid] = 1
- change = 0
- # but don't add admin or the anonymous user to the nosy list and
- # don't add the author if he just removed himself
- for msgid in messages:
- authid = db.msg.get(msgid, 'author')
- for recipid in db.msg.get(msgid, 'recipients'):
- if recipid == '1': continue
- if n.has_key(recipid): continue
- if db.user.get(recipid, 'username') == 'anonymous': continue
- if recipid == authid and not n.has_key(authid): continue
- change = 1
- nosy.append(recipid)
- if authid == '1': continue
- if n.has_key(authid): continue
- if db.user.get(authid, 'username') == 'anonymous': continue
- change = 1
- # append the author only after issue creation
- if oldvalues is None:
- nosy.append(authid)
- if change:
- cl.set(nodeid, nosy=nosy)
-
-
def init(db):
db.issue.react('create', nosyreaction)
db.issue.react('set', nosyreaction)
#
#$Log: not supported by cvs2svn $
+#Revision 1.9 2001/12/15 19:24:39 rochecompaan
+# . Modified cgi interface to change properties only once all changes are
+# collected, files created and messages generated.
+# . Moved generation of change note to nosyreactors.
+# . We now check for changes to "assignedto" to ensure it's added to the
+# nosy list.
+#
#Revision 1.8 2001/12/05 14:26:44 rochecompaan
#Removed generation of change note from "sendmessage" in roundupdb.py.
#The change note is now generated when the message is created.
diff --git a/roundup/templates/extended/detectors/nosyreaction.py b/roundup/templates/extended/detectors/nosyreaction.py
index 6dfe243189abfff4d23b09903c1e8d8364dc3525..d148b41bba90185c483b3ec8ff37c05a53a05fa5 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-#$Id: nosyreaction.py,v 1.9 2001-12-15 19:24:39 rochecompaan Exp $
+#$Id: nosyreaction.py,v 1.10 2002-01-11 23:22:29 richard Exp $
from roundup import roundupdb
except roundupdb.MessageSendError, message:
raise roundupdb.DetectorError, message
- # update the nosy list with the recipients from the new messages
- nosy = cl.get(nodeid, 'nosy')
- n = {}
- for nosyid in nosy: n[nosyid] = 1
- change = 0
- # but don't add admin or the anonymous user to the nosy list and
- # don't add the author if he just removed himself
- for msgid in messages:
- authid = db.msg.get(msgid, 'author')
- for recipid in db.msg.get(msgid, 'recipients'):
- if recipid == '1': continue
- if n.has_key(recipid): continue
- if db.user.get(recipid, 'username') == 'anonymous': continue
- if recipid == authid and not n.has_key(authid): continue
- change = 1
- nosy.append(recipid)
- if authid == '1': continue
- if n.has_key(authid): continue
- if db.user.get(authid, 'username') == 'anonymous': continue
- change = 1
- # append the author only after issue creation
- if oldvalues is None:
- nosy.append(authid)
- if change:
- cl.set(nodeid, nosy=nosy)
-
def init(db):
db.issue.react('create', nosyreaction)
#
#$Log: not supported by cvs2svn $
+#Revision 1.9 2001/12/15 19:24:39 rochecompaan
+# . Modified cgi interface to change properties only once all changes are
+# collected, files created and messages generated.
+# . Moved generation of change note to nosyreactors.
+# . We now check for changes to "assignedto" to ensure it's added to the
+# nosy list.
+#
#Revision 1.8 2001/12/05 14:26:44 rochecompaan
#Removed generation of change note from "sendmessage" in roundupdb.py.
#The change note is now generated when the message is created.
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index 12dbfe241e9a53bdfc1352be550d679ea8d2dc90..3d353d74060ed669effd74a4fa51ad6f5d0f3115 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.1 2002-01-02 02:31:38 richard Exp $
+# $Id: test_mailgw.py,v 1.2 2002-01-11 23:22:29 richard Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys
self.db = self.instance.open('sekrit')
self.db.user.create(username='Chef', address='chef@bork.bork.bork')
self.db.user.create(username='richard', address='richard@test')
+ self.db.user.create(username='mary', address='mary@test')
+ self.db.user.create(username='john', address='john@test')
def tearDown(self):
if os.path.exists(os.environ['SENDMAILDEBUG']):
This is a followup
+___________________________________________________
+"Roundup issue tracker" <issue_tracker@fill.me.in.>
+http://some.useful.url/issue1
+___________________________________________________
+''', 'Generated message not correct')
+
+ def testFollowup2(self):
+ self.testNewIssue()
+ message = cStringIO.StringIO('''Content-Type: text/plain;
+ charset="iso-8859-1"
+From: mary <mary@test>
+To: issue_tracker@fill.me.in.
+Message-Id: <followup_dummy_id>
+In-Reply-To: <dummy_test_message_id>
+Subject: [issue1] Testing...
+
+This is a second followup
+''')
+ handler = self.instance.MailGW(self.instance, self.db)
+ # TODO: fix the damn config - this is apalling
+ handler.main(message)
+ fname = 'fw2_%s.output'%self.count
+ open(fname,"w").write(open(os.environ['SENDMAILDEBUG']).read())
+ self.assertEqual(open(os.environ['SENDMAILDEBUG']).read(),
+'''FROM: roundup-admin@fill.me.in.
+TO: chef@bork.bork.bork, richard@test
+Content-Type: text/plain
+Subject: [issue1] Testing...
+To: chef@bork.bork.bork, richard@test
+From: mary <issue_tracker@fill.me.in.>
+Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
+MIME-Version: 1.0
+Message-Id: <followup_dummy_id>
+In-Reply-To: <dummy_test_message_id>
+
+
+mary <mary@test> added the comment:
+
+This is a second followup
+
___________________________________________________
"Roundup issue tracker" <issue_tracker@fill.me.in.>
http://some.useful.url/issue1
#
# $Log: not supported by cvs2svn $
+# Revision 1.1 2002/01/02 02:31:38 richard
+# Sorry for the huge checkin message - I was only intending to implement #496356
+# but I found a number of places where things had been broken by transactions:
+# . modified ROUNDUPDBSENDMAILDEBUG to be SENDMAILDEBUG and hold a filename
+# for _all_ roundup-generated smtp messages to be sent to.
+# . the transaction cache had broken the roundupdb.Class set() reactors
+# . newly-created author users in the mailgw weren't being committed to the db
+#
+# Stuff that made it into CHANGES.txt (ie. the stuff I was actually working
+# on when I found that stuff :):
+# . #496356 ] Use threading in messages
+# . detectors were being registered multiple times
+# . added tests for mailgw
+# . much better attaching of erroneous messages in the mail gateway
+#
#
#
#