Skip to content

Commit e1c49c6

Browse files
author
Richard Jones
committed
Added some rollbacks...
...where we were catching exceptions that would otherwise have stopped committing.
1 parent d120e83 commit e1c49c6

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

roundup/cgi_client.py

Lines changed: 18 additions & 1 deletion
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.74 2001-12-02 05:06:16 richard Exp $
18+
# $Id: cgi_client.py,v 1.75 2001-12-04 01:25:08 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -341,6 +341,7 @@ def shownode(self, message=None):
341341
else:
342342
message = _('nothing changed')
343343
except:
344+
self.db.rollback()
344345
s = StringIO.StringIO()
345346
traceback.print_exc(None, s)
346347
message = '<pre>%s</pre>'%cgi.escape(s.getvalue())
@@ -399,6 +400,7 @@ def showuser(self, message=None):
399400
message = _('%(changes)s edited ok')%{'changes':
400401
', '.join(changed)}
401402
except:
403+
self.db.rollback()
402404
s = StringIO.StringIO()
403405
traceback.print_exc(None, s)
404406
message = '<pre>%s</pre>'%cgi.escape(s.getvalue())
@@ -560,6 +562,7 @@ def newnode(self, message=None):
560562
# and some nice feedback for the user
561563
message = _('%(classname)s created ok')%{'classname': cn}
562564
except:
565+
self.db.rollback()
563566
s = StringIO.StringIO()
564567
traceback.print_exc(None, s)
565568
message = '<pre>%s</pre>'%cgi.escape(s.getvalue())
@@ -1068,6 +1071,20 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
10681071

10691072
#
10701073
# $Log: not supported by cvs2svn $
1074+
# Revision 1.74 2001/12/02 05:06:16 richard
1075+
# . We now use weakrefs in the Classes to keep the database reference, so
1076+
# the close() method on the database is no longer needed.
1077+
# I bumped the minimum python requirement up to 2.1 accordingly.
1078+
# . #487480 ] roundup-server
1079+
# . #487476 ] INSTALL.txt
1080+
#
1081+
# I also cleaned up the change message / post-edit stuff in the cgi client.
1082+
# There's now a clearly marked "TODO: append the change note" where I believe
1083+
# the change note should be added there. The "changes" list will obviously
1084+
# have to be modified to be a dict of the changes, or somesuch.
1085+
#
1086+
# More testing needed.
1087+
#
10711088
# Revision 1.73 2001/12/01 07:17:50 richard
10721089
# . We now have basic transaction support! Information is only written to
10731090
# the database when the commit() method is called. Only the anydbm

0 commit comments

Comments
 (0)