diff roundup/mailgw.py @ 430:350685601f37

Database transactions. . We now have basic transaction support! Information is only written to the database when the commit() method is called. Only the anydbm backend is modified in this way - neither of the bsddb backends have been. The mail, admin and cgi interfaces all use commit (except the admin tool doesn't have a commit command, so interactive users can't commit...) . Fixed login/registration forwarding the user to the right page (or not, on a failure)
author Richard Jones <richard@users.sourceforge.net>
date Sat, 01 Dec 2001 07:17:50 +0000
parents 831e91e23963
children a28a80b714f9
line wrap: on
line diff
--- a/roundup/mailgw.py	Fri Nov 30 20:47:58 2001 +0000
+++ b/roundup/mailgw.py	Sat Dec 01 07:17:50 2001 +0000
@@ -73,7 +73,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.37 2001-11-28 21:55:35 richard Exp $
+$Id: mailgw.py,v 1.38 2001-12-01 07:17:50 richard Exp $
 '''
 
 
@@ -355,6 +355,8 @@
         self.db.close()
         self.db = self.instance.open(username)
 
+        self.handle_message(author, username, 
+
         # re-get the class with the new database connection
         cl = self.db.getclass(classname)
 
@@ -516,6 +518,8 @@
 There was a problem with the message you sent:
    %s
 '''%message
+            # commit the changes to the DB
+            self.db.commit()
         else:
             # If just an item class name is found there, we attempt to create a
             # new item of that class with its "messages" property initialized to
@@ -554,6 +558,9 @@
    %s
 '''%message
 
+            # commit the new node(s) to the DB
+            self.db.commit()
+
 def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
         eol=re.compile(r'[\r\n]+'), signature=re.compile(r'^[>|\s]*[-_]+\s*$')):
     ''' The message body is divided into sections by blank lines.
@@ -594,6 +601,12 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.37  2001/11/28 21:55:35  richard
+#  . login_action and newuser_action return values were being ignored
+#  . Woohoo! Found that bloody re-login bug that was killing the mail
+#    gateway.
+#  (also a minor cleanup in hyperdb)
+#
 # Revision 1.36  2001/11/26 22:55:56  richard
 # Feature:
 #  . Added INSTANCE_NAME to configuration - used in web and email to identify

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