diff roundup/mailgw.py @ 389:7d7cb5319fc0

re-open the database as the author in mail handling
author Richard Jones <richard@users.sourceforge.net>
date Tue, 13 Nov 2001 21:44:44 +0000
parents be28f4c4feb6
children 399340646765
line wrap: on
line diff
--- a/roundup/mailgw.py	Mon Nov 12 23:17:38 2001 +0000
+++ b/roundup/mailgw.py	Tue Nov 13 21:44:44 2001 +0000
@@ -72,7 +72,7 @@
 an exception, the original message is bounced back to the sender with the
 explanatory message given in the exception. 
 
-$Id: mailgw.py,v 1.32 2001-11-12 22:04:29 richard Exp $
+$Id: mailgw.py,v 1.33 2001-11-13 21:44:44 richard Exp $
 '''
 
 
@@ -114,7 +114,8 @@
     r'\s*(?P<title>[^\[]+)(\[(?P<args>.+?)\])?', re.I)
 
 class MailGW:
-    def __init__(self, db):
+    def __init__(self, instance, db):
+        self.instance = instance
         self.db = db
 
     def main(self, fp):
@@ -294,6 +295,11 @@
         # handle the users
         #
         author = self.db.uidFromAddress(message.getaddrlist('from')[0])
+        # reopen the database as the author
+        username = self.db.user.get(author, 'username')
+        self.db.close()
+        self.db = self.instance.open(username)
+        # now update the recipients list
         recipients = []
         tracker_email = self.ISSUE_TRACKER_EMAIL.lower()
         for recipient in message.getaddrlist('to') + message.getaddrlist('cc'):
@@ -515,6 +521,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.32  2001/11/12 22:04:29  richard
+# oops, left debug in there
+#
 # Revision 1.31  2001/11/12 22:01:06  richard
 # Fixed issues with nosy reaction and author copies.
 #

Roundup Issue Tracker: http://roundup-tracker.org/